Class MatrixListProcessor
- java.lang.Object
-
- com.singularsys.extensions.lambda.StandardListProcessor
-
- com.singularsys.extensions.lambda.FieldListProcessor
-
- com.singularsys.extensions.lambda.MatrixListProcessor
-
- All Implemented Interfaces:
ListProcessor
,JepComponent
,java.io.Serializable
public class MatrixListProcessor extends FieldListProcessor
A list processor which accepts and producesVectorI
arguments.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MatrixListProcessor.MatrixIterable
An Iterable backed by aMatrixI
.class
MatrixListProcessor.MatrixIterator
An Iterator over aMatrixI
class
MatrixListProcessor.VectorIterable
An Iterable backed by aVectorI
.class
MatrixListProcessor.VectorIterator
An Iterator over aVectorI
-
Field Summary
-
Fields inherited from class com.singularsys.extensions.lambda.StandardListProcessor
sortFun
-
-
Constructor Summary
Constructors Constructor Description MatrixListProcessor(MatrixFactoryI mf, FieldI field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<java.lang.Object>
fromArgs(java.lang.Object arg)
Returns an Iterable over 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 byListProcessor.getList()
to the type used by Jep environment.JepComponent
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.java.util.List<java.lang.Object>
getList()
Get an empty list which elements can be added.void
init(Jep jep)
Initialize the component.-
Methods inherited from class com.singularsys.extensions.lambda.FieldListProcessor
compareResult
-
-
-
-
Constructor Detail
-
MatrixListProcessor
public MatrixListProcessor(MatrixFactoryI mf, FieldI field)
-
-
Method Detail
-
init
public void init(Jep jep)
Description copied from interface:JepComponent
Initialize the component. This methods 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:
init
in interfaceJepComponent
- Overrides:
init
in classStandardListProcessor
- Parameters:
jep
- the current Jep instance
-
getLightWeightInstance
public JepComponent getLightWeightInstance()
Description copied from interface:JepComponent
Gets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstance
in interfaceJepComponent
- Overrides:
getLightWeightInstance
in classStandardListProcessor
- Returns:
- either an new instance, null or 'this'.
-
fromArgs
public java.lang.Iterable<java.lang.Object> fromArgs(java.lang.Object arg) throws EvaluationException
Returns an Iterable over the input arguments.- Specified by:
fromArgs
in interfaceListProcessor
- Overrides:
fromArgs
in classStandardListProcessor
- Parameters:
arg
- an input to the function. Expects an argument of typeVectorI
orMatrixI
.- Returns:
- a
MatrixListProcessor.VectorIterable
orMatrixListProcessor.MatrixIterable
- Throws:
EvaluationException
- if argument is not of type VectorI or MatrixI
-
getList
public java.util.List<java.lang.Object> getList()
Description copied from interface:ListProcessor
Get an empty list which elements can be added.- Specified by:
getList
in interfaceListProcessor
- Overrides:
getList
in classStandardListProcessor
- Returns:
- an empty list
-
fromList
public java.lang.Object fromList(java.util.List<java.lang.Object> list) throws EvaluationException
Description copied from interface:ListProcessor
Convert a list produced byListProcessor.getList()
to the type used by Jep environment. Some implementations just return the input.- Specified by:
fromList
in interfaceListProcessor
- Overrides:
fromList
in classStandardListProcessor
- Parameters:
list
- a list- Returns:
- a type suitable for use by Jep.
- Throws:
EvaluationException
- on error
-
fromCollection
public java.lang.Object fromCollection(java.util.Collection<java.lang.Object> tree) throws EvaluationException
Description copied from interface:ListProcessor
Convert a general collection into a type used the the Jep environment.- Specified by:
fromCollection
in interfaceListProcessor
- Overrides:
fromCollection
in classStandardListProcessor
- Parameters:
tree
- input collection- Returns:
- a type suitable for use by Jep
- Throws:
EvaluationException
- on error
-
-