X-Git-Url: http://git.megacz.com/?p=org.ibex.classgen.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fclassgen%2FType.java;h=f136d84b0e946fdabd306fddb234a61787668a8f;hp=2faa5903b99be279b0281395cbb37595d91c7f71;hb=6d2abcdebf08ecd85d201f56485e3358cc41407b;hpb=5a08820e18996e02dcf0ba12f502ba7f0bc781ea diff --git a/src/org/ibex/classgen/Type.java b/src/org/ibex/classgen/Type.java index 2faa590..f136d84 100644 --- a/src/org/ibex/classgen/Type.java +++ b/src/org/ibex/classgen/Type.java @@ -100,9 +100,6 @@ public class Type implements CGConst { return a; } - public abstract class Body extends HasFlags { - } - public Field field(String name, Type type) { return new Field(name, type); } public Method method(String name, Type returnType, Type[] argTypes) { return new Method(name, returnType, argTypes); } public Method method(String name, String typeDescriptor) { @@ -135,6 +132,14 @@ public class Type implements CGConst { private Member(String name) { this.name = name; } public Type.Class getDeclaringClass() { return Type.Class.this; } public abstract String getDescriptor(); + public boolean equals(Object o_) { + if(!(o_ instanceof Member)) return false; + Member o = (Member) o_; + return o.getDeclaringClass().equals(getDeclaringClass()) && + o.name.equals(name) && + o.getDescriptor().equals(getDescriptor()); + } + public int hashCode() { return getDeclaringClass().hashCode() ^ name.hashCode() ^ getDescriptor().hashCode(); } public String toString() { return debugToString(); } public abstract String debugToString(); } @@ -142,7 +147,7 @@ public class Type implements CGConst { public class Field extends Member { public final Type type; private Field(String name, Type t) { super(name); this.type = t; } - public String getDescriptor() { return type.getDescriptor(); } + public String getTypeDescriptor() { return type.getDescriptor(); } public Type getType() { return type; } public String debugToString() { return getDeclaringClass()+"."+name+"["+type+"]"; } public class Body extends HasFlags { @@ -186,7 +191,6 @@ public class Type implements CGConst { this.argTypes = argTypes; this.returnType = returnType; } - //public Method.Body getBody(Context cx) { } public String getDescriptor() { StringBuffer sb = new StringBuffer(argTypes.length*4); sb.append("(");