1 30 31 47 package jbet; 48 import java.io.*; 49 50 class CpLong extends CpEntry { 51 long value; 52 53 57 CpLong(int i, CPInterface cp) { 58 super(i, CPInterface.CONSTANT_Long, cp); 59 } 60 61 65 CpLong(CPInterface cp, long l) { 66 super(cp.poolCount(), CPInterface.CONSTANT_Long, cp); 67 value = l; 68 } 69 70 73 public String toString() { 74 return String.valueOf(value); 75 } 76 77 80 public int hashCode() { 81 return 17 * (int)value; 82 } 83 84 88 public boolean equals(Object o) { 89 return (o instanceof CpLong) && ((CpLong)o).value == value; 90 } 91 92 95 void write(DataOutputStream dataOut) throws IOException { 96 dataOut.writeByte(tag); 97 dataOut.writeLong(value); 98 } 99 } 100 | Popular Tags |