1 30 31 48 package jbet; 49 import java.io.*; 50 51 class CpDouble extends CpEntry { 52 double value; 53 CpDouble(int i, CPInterface cp) { 54 super(i, CPInterface.CONSTANT_Double, cp); 55 } 56 57 CpDouble(CPInterface cp, double d) { 58 super(cp.poolCount(), CPInterface.CONSTANT_Double, cp); 59 value = d; 60 } 61 62 63 public String toString() { 64 return String.valueOf(value); 65 } 66 67 public int hashCode() { 68 return 17 * (int)value; 69 } 70 71 public boolean equals(Object o) { 72 return (o instanceof CpDouble) && ((CpDouble)o).value == value; 73 } 74 75 void write(DataOutputStream dataOut) throws IOException { 76 dataOut.writeByte(tag); 77 dataOut.writeDouble(value); 78 } 79 } 80 | Popular Tags |