1 52 53 package com.go.trove.classfile; 54 55 import java.io.*; 56 57 65 public class ConstantDoubleInfo extends ConstantInfo { 66 private Double mValue; 67 68 73 static ConstantDoubleInfo make(ConstantPool cp, double value) { 74 ConstantInfo ci = new ConstantDoubleInfo(value); 75 return (ConstantDoubleInfo)cp.addConstant(ci); 76 } 77 78 ConstantDoubleInfo(double value) { 79 super(TAG_DOUBLE); 80 mValue = new Double (value); 81 } 82 83 ConstantDoubleInfo(Double value) { 84 super(TAG_DOUBLE); 85 mValue = value; 86 } 87 88 public Double getValue() { 89 return mValue; 90 } 91 92 public int hashCode() { 93 return mValue.hashCode(); 94 } 95 96 public boolean equals(Object obj) { 97 if (obj instanceof ConstantDoubleInfo) { 98 ConstantDoubleInfo other = (ConstantDoubleInfo)obj; 99 return mValue.equals(other.mValue); 100 } 101 102 return false; 103 } 104 105 int getEntryCount() { 106 return 2; 107 } 108 109 public void writeTo(DataOutput dout) throws IOException { 110 super.writeTo(dout); 111 dout.writeDouble(mValue.doubleValue()); 112 } 113 114 public String toString() { 115 return "CONSTANT_Double_info: " + getValue(); 116 } 117 } 118 | Popular Tags |