Class StandardListProcessor
java.lang.Object
com.singularsys.extensions.lambda.StandardListProcessor
- All Implemented Interfaces:
ListProcessor,JepComponent,Serializable
- Direct Known Subclasses:
MatrixListProcessor,PaddingListProcessor
Default implementation of a ListProcessor.
Works with the standard Jep
List
and Ele functions which use
Vector<Object> for lists.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an iterable view of the input arguments.fromCollection(Collection<Object> tree) Convert a general collection into a type used the Jep environment.Convert a list produced byListProcessor.makeList()to the type used by Jep environment.Gets a light-weight instance suitable for using in multiple threads.voidInitialize the component.makeList()Get an empty list which elements can be added.
-
Constructor Details
-
StandardListProcessor
public StandardListProcessor()
-
-
Method Details
-
init
Description copied from interface:JepComponentInitialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
fromArgs
Description copied from interface:ListProcessorReturns an iterable view of the input arguments.- Specified by:
fromArgsin interfaceListProcessor- Parameters:
arg- typically a list, but can be any type. If the type is not a list, an iterator with a single element is returned.- Returns:
- an Iterable view of the argument
- Throws:
EvaluationException- on error
-
makeList
Description copied from interface:ListProcessorGet an empty list which elements can be added.- Specified by:
makeListin interfaceListProcessor- Returns:
- an empty list
-
fromList
Description copied from interface:ListProcessorConvert a list produced byListProcessor.makeList()to the type used by Jep environment. Some implementations just return the input.- Specified by:
fromListin interfaceListProcessor- Parameters:
list- a list- Returns:
- a type suitable for use by Jep.
- Throws:
EvaluationException- on error
-
fromCollection
Description copied from interface:ListProcessorConvert a general collection into a type used the Jep environment.- Specified by:
fromCollectionin interfaceListProcessor- Parameters:
tree- input collection- Returns:
- a type suitable for use by Jep
- Throws:
EvaluationException- on error
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-