Class DispatchFunction
- java.lang.Object
-
- com.googlecode.aviator.runtime.type.AviatorObject
-
- com.googlecode.aviator.runtime.function.AbstractVariadicFunction
-
- com.googlecode.aviator.runtime.function.DispatchFunction
-
- All Implemented Interfaces:
AviatorFunction
,java.io.Serializable
,java.lang.Runnable
,java.util.concurrent.Callable<AviatorObject>
public class DispatchFunction extends AbstractVariadicFunction
Dispatch function by argument arity.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Object[]
EMPTY_VAR_ARGS
private java.util.IdentityHashMap<java.lang.Integer,LambdaFunction>
functions
private java.lang.String
name
private static long
serialVersionUID
private java.util.TreeMap<java.lang.Integer,LambdaFunction>
variadicFunctions
-
Fields inherited from class com.googlecode.aviator.runtime.type.AviatorObject
metadata
-
-
Constructor Summary
Constructors Constructor Description DispatchFunction(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Get the function namevoid
install(LambdaFunction fn)
(package private) static AviatorObject[]
processVariadicArgs(java.util.Map<java.lang.String,java.lang.Object> env, int arity, LambdaFunction fn, AviatorObject[] args)
AviatorObject
variadicCall(java.util.Map<java.lang.String,java.lang.Object> env, AviatorObject... args)
Call with variadic arguments.The subclass must implement this method.-
Methods inherited from class com.googlecode.aviator.runtime.function.AbstractVariadicFunction
call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, desc, getAviatorType, getValue, innerCompare, run
-
Methods inherited from class com.googlecode.aviator.runtime.type.AviatorObject
add, bitAnd, bitNot, bitOr, bitXor, booleanValue, compare, compareEq, defineValue, deref, div, exponent, getElement, getMetadata, isNull, match, meta, mod, mult, neg, not, numberValue, setValue, shiftLeft, shiftRight, stringValue, sub, toString, unsignedShiftRight, withMeta, withoutMeta
-
-
-
-
Field Detail
-
EMPTY_VAR_ARGS
private static final java.lang.Object[] EMPTY_VAR_ARGS
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
functions
private final java.util.IdentityHashMap<java.lang.Integer,LambdaFunction> functions
-
variadicFunctions
private final java.util.TreeMap<java.lang.Integer,LambdaFunction> variadicFunctions
-
name
private final java.lang.String name
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:AviatorFunction
Get the function name- Returns:
-
install
public void install(LambdaFunction fn)
-
variadicCall
public AviatorObject variadicCall(java.util.Map<java.lang.String,java.lang.Object> env, AviatorObject... args)
Description copied from class:AbstractVariadicFunction
Call with variadic arguments.The subclass must implement this method.- Specified by:
variadicCall
in classAbstractVariadicFunction
- Returns:
-
processVariadicArgs
static AviatorObject[] processVariadicArgs(java.util.Map<java.lang.String,java.lang.Object> env, int arity, LambdaFunction fn, AviatorObject[] args)
-
-