Package gw.lang.reflect.features
Class BoundMethodReference<R,T>
- java.lang.Object
-
- gw.lang.reflect.features.FeatureReference<R,T>
-
- gw.lang.reflect.features.BoundMethodReference<R,T>
-
- All Implemented Interfaces:
IFeatureReference<R,T>,IInvokableFeatureReference<R,T>,IMethodReference<R,T>
public class BoundMethodReference<R,T> extends FeatureReference<R,T> implements IMethodReference<R,T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]_boundValuesprivate java.lang.Object_ctxprivate IMethodInfo_miprivate IType_rootTypeprivate boolean_voidReturn
-
Constructor Summary
Constructors Modifier Constructor Description privateBoundMethodReference()BoundMethodReference(IType rootType, java.lang.Object ctx, java.lang.String funcName, IType[] params, java.lang.Object[] boundValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundMethodReferencecopyWithVoidReturn()booleanequals(java.lang.Object o)java.lang.Objectevaluate(java.lang.Object... args)Evaluates reflectivelyjava.lang.Objectevaluate(java.util.Iterator args)java.lang.Object[]getBoundArgValues()java.lang.ObjectgetCtx()IFeatureInfogetFeatureInfo()java.util.List<IType>getFullArgTypes()TgetInvoke()Returns the method reference as a block in an invocation-friendly syntaxIMethodInfogetMethodInfo()Returns the method info for this referenceITypegetRootType()inthashCode()protected booleanhasReturn()TtoBlock()Returns the method reference as a block in a transformation-friendly syntax
-
-
-
Field Detail
-
_mi
private IMethodInfo _mi
-
_rootType
private IType _rootType
-
_ctx
private java.lang.Object _ctx
-
_boundValues
private java.lang.Object[] _boundValues
-
_voidReturn
private boolean _voidReturn
-
-
Method Detail
-
copyWithVoidReturn
public BoundMethodReference copyWithVoidReturn()
- Specified by:
copyWithVoidReturnin interfaceIMethodReference<R,T>
-
hasReturn
protected boolean hasReturn()
- Overrides:
hasReturnin classFeatureReference<R,T>
-
getMethodInfo
public IMethodInfo getMethodInfo()
Description copied from interface:IMethodReferenceReturns the method info for this reference- Specified by:
getMethodInfoin interfaceIMethodReference<R,T>
-
getInvoke
public T getInvoke()
Description copied from interface:IInvokableFeatureReferenceReturns the method reference as a block in an invocation-friendly syntax- Specified by:
getInvokein interfaceIInvokableFeatureReference<R,T>
-
evaluate
public java.lang.Object evaluate(java.lang.Object... args)
Description copied from interface:IInvokableFeatureReferenceEvaluates reflectively- Specified by:
evaluatein interfaceIInvokableFeatureReference<R,T>
-
evaluate
public java.lang.Object evaluate(java.util.Iterator args)
- Specified by:
evaluatein classFeatureReference<R,T>
-
getRootType
public IType getRootType()
- Specified by:
getRootTypein interfaceIFeatureReference<R,T>
-
toBlock
public T toBlock()
Description copied from interface:IInvokableFeatureReferenceReturns the method reference as a block in a transformation-friendly syntax- Specified by:
toBlockin interfaceIInvokableFeatureReference<R,T>
-
getBoundArgValues
public java.lang.Object[] getBoundArgValues()
- Specified by:
getBoundArgValuesin interfaceIInvokableFeatureReference<R,T>- Returns:
- an array of bound values if the feature had them, and null otherwise
-
getFeatureInfo
public IFeatureInfo getFeatureInfo()
- Specified by:
getFeatureInfoin interfaceIFeatureReference<R,T>
-
getFullArgTypes
public java.util.List<IType> getFullArgTypes()
- Specified by:
getFullArgTypesin classFeatureReference<R,T>
-
getCtx
public java.lang.Object getCtx()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-