Class PaddingListProcessor
java.lang.Object
com.singularsys.extensions.lambda.StandardListProcessor
com.singularsys.extensions.lambda.PaddingListProcessor
- All Implemented Interfaces:
ListProcessor,JepComponent,Serializable
A list processor which accepts and produces
VectorI arguments
and can produce MatrixI arguments with all rows the same length.
Rows in a matrix can be different lengths and the matrix expanded
to fit the largest row.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an Iterable over 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
-
PaddingListProcessor
-
-
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- Overrides:
initin classStandardListProcessor- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Overrides:
getLightWeightInstancein classStandardListProcessor- Returns:
- either a new instance, null or 'this'.
-
fromArgs
Returns an Iterable over the input arguments.- Specified by:
fromArgsin interfaceListProcessor- Overrides:
fromArgsin classStandardListProcessor- Parameters:
arg- an input to the function. Expects an argument of typeVectorIorMatrixI.- Returns:
- a
PaddingListProcessor.VectorIterableorPaddingListProcessor.MatrixIterable - Throws:
EvaluationException- if argument is not of type VectorI or MatrixI
-
makeList
Description copied from interface:ListProcessorGet an empty list which elements can be added.- Specified by:
makeListin interfaceListProcessor- Overrides:
makeListin classStandardListProcessor- 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- Overrides:
fromListin classStandardListProcessor- 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- Overrides:
fromCollectionin classStandardListProcessor- Parameters:
tree- input collection- Returns:
- a type suitable for use by Jep
- Throws:
EvaluationException- on error
-