1 package org.ibex.classgen;
3 /** This class represents Method references. It is used as an argument to the
4 INVOKESTATIC, INVOKEVIRTUAL, INVOKESPEICAL, and INVOKEINTERFACE bytecodes
5 @see CGConst#INVOKESTATIC
6 @see CGConst#INVOKEVIRTUAL
7 @see CGConst#INVOKESPECIAL
8 @see CGConst#INVOKEINTERFACE
10 public class MethodRef extends MemberRef {
12 final Type[] argTypes;
13 final Type returnType;
15 /** Create a reference to method <i>name</i> of class <i>c</i> with the return type <i>ret</i> and the
16 arguments <i>args</i> */
17 public MethodRef(Type.Class c, String name, Type returnType, Type[] argTypes) {
19 this.argTypes = argTypes;
20 this.returnType = returnType;
23 public String getDescriptor() {
24 StringBuffer sb = new StringBuffer(argTypes.length*4);
26 for(int i=0;i<argTypes.length;i++) sb.append(argTypes[i].getDescriptor());
28 sb.append(returnType.getDescriptor());