1 package com.sun.org.apache.bcel.internal.classfile; 2 3 56 57 import com.sun.org.apache.bcel.internal.Constants; 58 import java.io.*; 59 60 69 public final class ConstantDouble extends Constant implements ConstantObject { 70 private double bytes; 71 72 75 public ConstantDouble(double bytes) { 76 super(Constants.CONSTANT_Double); 77 this.bytes = bytes; 78 } 79 80 83 public ConstantDouble(ConstantDouble c) { 84 this(c.getBytes()); 85 } 86 87 93 ConstantDouble(DataInputStream file) throws IOException 94 { 95 this(file.readDouble()); 96 } 97 98 105 public void accept(Visitor v) { 106 v.visitConstantDouble(this); 107 } 108 114 public final void dump(DataOutputStream file) throws IOException 115 { 116 file.writeByte(tag); 117 file.writeDouble(bytes); 118 } 119 122 public final double getBytes() { return bytes; } 123 126 public final void setBytes(double bytes) { 127 this.bytes = bytes; 128 } 129 132 public final String toString() 133 { 134 return super.toString() + "(bytes = " + bytes + ")"; 135 } 136 137 139 public Object getConstantValue(ConstantPool cp) { 140 return new Double (bytes); 141 } 142 } 143 | Popular Tags |