1 15 16 package javassist.bytecode.annotation; 17 18 import javassist.bytecode.ConstPool; 19 import java.io.IOException ; 20 21 27 public class LongMemberValue extends MemberValue { 28 int valueIndex; 29 30 36 public LongMemberValue(int index, ConstPool cp) { 37 super('J', cp); 38 this.valueIndex = index; 39 } 40 41 46 public LongMemberValue(long j, ConstPool cp) { 47 super('J', cp); 48 setValue(j); 49 } 50 51 54 public LongMemberValue(ConstPool cp) { 55 super('J', cp); 56 setValue(0L); 57 } 58 59 62 public long getValue() { 63 return cp.getLongInfo(valueIndex); 64 } 65 66 69 public void setValue(long newValue) { 70 valueIndex = cp.addLongInfo(newValue); 71 } 72 73 76 public String toString() { 77 return Long.toString(getValue()); 78 } 79 80 void write(AnnotationsWriter writer) throws IOException { 81 writer.constValueIndex(getValue()); 82 } 83 84 87 public void accept(MemberValueVisitor visitor) { 88 visitor.visitLongMemberValue(this); 89 } 90 } 91 | Popular Tags |