00001 package de.fub.bytecode.generic;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 public class DCONST extends Instruction implements ConstantPushInstruction {
00012 private double value;
00013
00014
00015
00016
00017
00018 DCONST() {}
00019 public DCONST(double f) {
00020 super(DCONST_0, (short)1);
00021
00022 if(f == 0.0)
00023 tag = DCONST_0;
00024 else if(f == 1.0)
00025 tag = DCONST_1;
00026 else
00027 throw new ClassGenException("DCONST can be used only for 0.0 and 1.0: " + f);
00028
00029 value = f;
00030 }
00031 public Number getValue() { return new Double(value); }
00032 }