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 InterfaceMethodrefConstant extends Constant { 37 ClassConstant _class; 38 InterfaceMethodrefConstant() {} 39 NameAndTypeConstant signature; 40 InterfaceMethodrefConstant(ClassConstant _class, 41 NameAndTypeConstant signature) { 42 this._class = _class; 43 this.signature = signature; 44 } 45 void writeTo(DataOutputStream stream) throws IOException { 46 stream.writeByte(INTERFACE_METHOD_REF_TAG); 47 _class.writeIndex(stream); 48 signature.writeIndex(stream); 49 } 50 public String toString() { 51 return rep(getIndex(), 52 "(imethodref " + _class + " " + signature + ")"); 53 } 54 public boolean equals(Object other) { 55 if (! (other instanceof InterfaceMethodrefConstant)) return false; 56 InterfaceMethodrefConstant o = (InterfaceMethodrefConstant) other; 57 return _class == o._class && signature == o.signature; 58 } 59 public int hashCode() { 60 return _class.hashCode() + signature.hashCode() + 61 INTERFACE_METHOD_REF_TAG; 62 } 63 void readFrom(DataInputStream stream, ConstantPool pool) throws IOException { 64 _class = (ClassConstant) 65 pool.get(stream.readUnsignedShort(), new ClassConstant()); 66 signature = (NameAndTypeConstant) 67 pool.get(stream.readUnsignedShort(), new NameAndTypeConstant()); 68 } 69 } 70 | Popular Tags |