X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fclassgen%2FMethodRef.java;fp=src%2Forg%2Fibex%2Fclassgen%2FMethodRef.java;h=cb546bdbf9396824851b85914751936205e2c7b5;hb=bc9112573cba51be5e7d285ccd3e496be4278c63;hp=0000000000000000000000000000000000000000;hpb=cb0bae954e7dd0067e77c436c78ee19ace52d9e3;p=org.ibex.classgen.git diff --git a/src/org/ibex/classgen/MethodRef.java b/src/org/ibex/classgen/MethodRef.java new file mode 100644 index 0000000..cb546bd --- /dev/null +++ b/src/org/ibex/classgen/MethodRef.java @@ -0,0 +1,24 @@ +package org.ibex.classgen; + +public class MethodRef extends ClassGen.FieldMethodRef { + public MethodRef(Type.Object c, ClassGen.NameAndType t) { super(c,t); } + public MethodRef(Type.Object c, String name, String descriptor) { + this(c,new ClassGen.NameAndType(name,descriptor)); + } + public MethodRef(Type.Object c, String name, Type ret, Type[] args) { + this(c,name,getDescriptor(ret,args)); + } + public MethodRef(String s, String name, Type ret, Type[] args) { + this(new Type.Object(s),name,ret,args); + } + + static String getDescriptor(Type ret, Type[] args) { + StringBuffer sb = new StringBuffer(args.length*4); + sb.append("("); + for(int i=0;i