1 52 53 package com.go.trove.classfile; 54 55 import java.io.*; 56 57 65 public class ConstantIntegerInfo extends ConstantInfo { 66 private Integer mValue; 67 68 73 static ConstantIntegerInfo make(ConstantPool cp, int value) { 74 ConstantInfo ci = new ConstantIntegerInfo(value); 75 return (ConstantIntegerInfo)cp.addConstant(ci); 76 } 77 78 ConstantIntegerInfo(int value) { 79 super(TAG_INTEGER); 80 mValue = new Integer (value); 81 } 82 83 ConstantIntegerInfo(Integer value) { 84 super(TAG_INTEGER); 85 mValue = value; 86 } 87 88 public Integer 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 ConstantIntegerInfo) { 98 ConstantIntegerInfo other = (ConstantIntegerInfo)obj; 99 return mValue.equals(other.mValue); 100 } 101 102 return false; 103 } 104 105 boolean hasPriority() { 106 return true; 107 } 108 109 public void writeTo(DataOutput dout) throws IOException { 110 super.writeTo(dout); 111 dout.writeInt(mValue.intValue()); 112 } 113 114 public String toString() { 115 return "CONSTANT_Integer_info: " + getValue(); 116 } 117 } 118 | Popular Tags |