Class JavaFunction
java.lang.Object
com.github.basking2.sdsai.itrex.functions.AbstractFunction2<String,Object,Object>
com.github.basking2.sdsai.itrex.functions.java.JavaFunction
- All Implemented Interfaces:
FunctionInterface<Object>
,BiFunction<Iterator<?>,
EvaluationContext, Object>
Function that takes the name of a function, a target object, and a list or iterable of arguments.
If the argument is a collection or an iterator, each element is marshaled as an argument.
If the argument is neither an collection nor an iterator, it is marshaled as an argument itself.
<pre>
[java new [classOf java.util.ArrayList]]
</pre>
<pre>
[java add [get myArray] [list 1]]
</pre>
<pre>
[java add [get myArray] 1]
</pre>
-
Constructor Summary
-
Method Summary
Methods inherited from class com.github.basking2.sdsai.itrex.functions.AbstractFunction2
apply
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
JavaFunction
public JavaFunction()
-
-
Method Details
-
applyImpl
protected Object applyImpl(String functionName, Object target, Iterator<?> rest, EvaluationContext context) Description copied from class:AbstractFunction2
Overriders of this class should implement this.- Specified by:
applyImpl
in classAbstractFunction2<String,
Object, Object> - Parameters:
functionName
- The desired parameter.target
- The desired parameter.rest
- Any unused arguments.context
- The evaluation context.- Returns:
- The produced object.
-
findMethod
-