gnu.kawa.reflect

Class ClassMethodProc

Implemented Interfaces:
Externalizable, HasSetter, Named

public class ClassMethodProc
extends ProcedureN
implements Externalizable, HasSetter

A pairing of (class, method-name) treated as a procedure. Usually equivalent to (lambda args (apply invoke-static ctype mname args)). However, if the class is null, corresponds to invoke, and if method-name starts with a period, corresponds to static-field or field.

Field Summary

static String
CAST_METHOD_NAME
Pseudo-method-name for the cast operation.
static String
INSTANCEOF_METHOD_NAME
Pseudo-method-name for class-membership-test (instanceof) operation.
static Method
makeMethod
static QuoteExp
makeMethodExp

Fields inherited from class gnu.mapping.ProcedureN

noArgs

Method Summary

void
apply(CallContext ctx)
Object
applyN(Object[] args)
static ClassMethodProc
make(ClassType ctype, String methodName)
static ApplyExp
makeExp(Expression clas, Expression member)
void
readExternal(ObjectInput in)
static ApplyExp
rewrite(ApplyExp exp)
Rewrite/optimize ((ClassMethodProc:make CLASS "METHOD") args).
void
setN(Object[] args)
String
toString()
void
writeExternal(ObjectOutput out)

Methods inherited from class gnu.mapping.ProcedureN

apply0, apply1, apply2, apply3, apply4, applyN

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString

Field Details

CAST_METHOD_NAME

public static final String CAST_METHOD_NAME
Pseudo-method-name for the cast operation.

INSTANCEOF_METHOD_NAME

public static final String INSTANCEOF_METHOD_NAME
Pseudo-method-name for class-membership-test (instanceof) operation.

makeMethod

public static final Method makeMethod

makeMethodExp

public static final QuoteExp makeMethodExp

Method Details

apply

public void apply(CallContext ctx)
            throws Throwable
Overrides:
apply in interface Procedure

applyN

public Object applyN(Object[] args)
            throws Throwable
Overrides:
applyN in interface ProcedureN

make

public static ClassMethodProc make(ClassType ctype,
                                   String methodName)

makeExp

public static ApplyExp makeExp(Expression clas,
                               Expression member)

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException

rewrite

public static ApplyExp rewrite(ApplyExp exp)
Rewrite/optimize ((ClassMethodProc:make CLASS "METHOD") args).

setN

public void setN(Object[] args)
            throws Throwable
Overrides:
setN in interface Procedure

toString

public String toString()
Overrides:
toString in interface Procedure

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException