| 1 24 25 package org.aspectj.compiler.base.bcg.pool; 26 27 import org.aspectj.compiler.base.bcg.*; 28 29 import java.io.*; 30 import java.util.*; 31 32 import org.aspectj.compiler.base.ast.ArrayType; 33 import org.aspectj.compiler.base.ast.NameType; 34 import org.aspectj.compiler.base.ast.RefType; 35 36 public class IntConstant extends Constant { 37 int value; 38 IntConstant() {} 39 IntConstant(int value) { 40 this.value = value; 41 } 42 void writeTo(DataOutputStream stream) throws IOException { 43 stream.writeByte(INT_TAG); 44 stream.writeInt(value); 45 } 46 public String toString() { 47 return rep(getIndex(), 48 "(int " + value + ")"); 49 } 50 public boolean equals(Object other) { 51 if (! (other instanceof IntConstant)) return false; 52 IntConstant o = (IntConstant) other; 53 return value == o.value; 54 } 55 public int hashCode() { 56 return value * 2; 57 } 58 59 void readFrom(DataInputStream stream, ConstantPool pool) throws IOException { 60 value = stream.readInt(); 61 } 62 } 63 | Popular Tags |