1 52 53 package com.go.trove.classfile; 54 55 import java.io.*; 56 57 65 public class ConstantLongInfo extends ConstantInfo { 66 private Long mValue; 67 68 73 static ConstantLongInfo make(ConstantPool cp, long value) { 74 ConstantInfo ci = new ConstantLongInfo(value); 75 return (ConstantLongInfo)cp.addConstant(ci); 76 } 77 78 ConstantLongInfo(long value) { 79 super(TAG_LONG); 80 mValue = new Long (value); 81 } 82 83 ConstantLongInfo(Long value) { 84 super(TAG_LONG); 85 mValue = value; 86 } 87 88 public Long 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 ConstantLongInfo) { 98 ConstantLongInfo other = (ConstantLongInfo)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.writeLong(mValue.longValue()); 112 } 113 114 public String toString() { 115 return "CONSTANT_Long_info: " + getValue(); 116 } 117 } 118 | Popular Tags |