Interface ListProcessor
-
- All Superinterfaces:
JepComponent
,java.io.Serializable
- All Known Implementing Classes:
FieldListProcessor
,MatrixListProcessor
,StandardListProcessor
public interface ListProcessor extends JepComponent
Defines some utility methods use by higher order functions for processing lists of data, where the actual types used by Jep may differ.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
compareResult(java.lang.Object val)
Converts results from Jep evaluation to an integer -1, 0 or 1 used in comparison.java.lang.Iterable<java.lang.Object>
fromArgs(java.lang.Object arg)
Returns an iterator view of the input arguments.java.lang.Object
fromCollection(java.util.Collection<java.lang.Object> tree)
Convert a general collection into a type used the the Jep environment.java.lang.Object
fromList(java.util.List<java.lang.Object> list)
Convert a list produced bygetList()
to the type used by Jep environment.java.util.List<java.lang.Object>
getList()
Get an empty list which elements can be added.-
Methods inherited from interface com.singularsys.jep.JepComponent
getLightWeightInstance, init
-
-
-
-
Method Detail
-
fromArgs
java.lang.Iterable<java.lang.Object> fromArgs(java.lang.Object arg) throws EvaluationException
Returns an iterator view of the input arguments.- Parameters:
arg
- an input to the function- Returns:
- an Iterable view of the argument
- Throws:
EvaluationException
- on error
-
getList
java.util.List<java.lang.Object> getList()
Get an empty list which elements can be added.- Returns:
- an empty list
-
fromList
java.lang.Object fromList(java.util.List<java.lang.Object> list) throws EvaluationException
Convert a list produced bygetList()
to the type used by Jep environment. Some implementations just return the input.- Parameters:
list
- a list- Returns:
- a type suitable for use by Jep.
- Throws:
EvaluationException
- on error
-
fromCollection
java.lang.Object fromCollection(java.util.Collection<java.lang.Object> tree) throws EvaluationException
Convert a general collection into a type used the the Jep environment.- Parameters:
tree
- input collection- Returns:
- a type suitable for use by Jep
- Throws:
EvaluationException
- on error
-
compareResult
int compareResult(java.lang.Object val) throws EvaluationException
Converts results from Jep evaluation to an integer -1, 0 or 1 used in comparison.- Parameters:
val
- input value from Jep environment- Returns:
- -1, 0 or 1
- Throws:
EvaluationException
- on error- See Also:
Comparator.compare(Object, Object)
-
-