Class StreamOperatorTable
java.lang.Object
com.singularsys.jep.EmptyOperatorTable
com.singularsys.jep.OperatorTable2
com.singularsys.jep.standard.StandardOperatorTable2
com.singularsys.extensions.lambda.LambdaOperatorTable
com.singularsys.extensions.chained.ChainedOperatorTable
com.singularsys.extensions.stream.StreamOperatorTable
- All Implemented Interfaces:
JepComponent,OperatorTableI,Serializable
An OperatorTable for stream package.
It defines the chaining operator
. that allows chained syntax
by overloads the dot operator
[1..10] . sum() and extends the lambda operator table to define
the lambda definition operator x => x^2,
the optional range operator [1..5],
the optinal send to operator x^2 -> y,
the optional ternary operator code ? x : y.
The range operator uses the StreamRange function to return a stream of all the items.
The main symbols used are defined in the constructor,
the symbols list brackets and ternary operators are set in the
properties file.- Since:
- Jep 4.1 extensions 2.2
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.singularsys.extensions.chained.ChainedOperatorTable
ChainedOperatorTable.ChainedOperatorsNested classes/interfaces inherited from class com.singularsys.extensions.lambda.LambdaOperatorTable
LambdaOperatorTable.LambdaOperatorsNested classes/interfaces inherited from class com.singularsys.jep.OperatorTable2
OperatorTable2.BasicOperators, OperatorTable2.PsudoOperators, OperatorTable2.SpecialOperatorsNested classes/interfaces inherited from class com.singularsys.jep.EmptyOperatorTable
EmptyOperatorTable.OperatorKey -
Constructor Summary
ConstructorsModifierConstructorDescriptionStreamOperatorTable(OperatorTable2 oldTable, String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary) A decorator constructor.StreamOperatorTable(OperatorTable2 oldTable, String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary, FieldI field) A decorator constructor.StreamOperatorTable(String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary) Constructor with specified symbols.StreamOperatorTable(String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary, FieldI field) Constructor with specified symbols.protected -
Method Summary
Modifier and TypeMethodDescriptionCreate a new version of this OperatorTable.Methods inherited from class com.singularsys.extensions.chained.ChainedOperatorTable
getChainingOp, getOverloadedChainingOpMethods inherited from class com.singularsys.extensions.lambda.LambdaOperatorTable
getLambdaDef, getSendTo, getTernary, setBasicPfmcs, setPsudoPfmcs, setSpecialPfmcsMethods inherited from class com.singularsys.jep.OperatorTable2
getAdd, getAnd, getAssign, getCross, getDivide, getDot, getEle, getEQ, getGE, getGT, getLE, getList, getLT, getMod, getMultiply, getNE, getNop, getNot, getOr, getPower, getRange, getSubtract, getUDivide, getUMinus, getUPlusMethods inherited from class com.singularsys.jep.EmptyOperatorTable
addOperator, addOperator, addOperator, appendOperator, appendOperator, entrySet, getAllOperatorsByName, getKey, getKeys, getLightWeightInstance, getNumOps, getOperator, getOperatorByName, getOperatorMap, getOperators, getOperatorsByName, getOperatorsBySymbol, init, insertOperator, insertOperator, keySet, removeOperator, removeOperator, replaceOperator, replaceOperator, setBinaryInverseOp, setDistributiveOver, setGroupOperatorRelations, setGroupOperatorRelations, setInverseOp, setPrecedenceTable, setRootOp, setStandardOperatorRelations, threadSafeMapCopy, toString
-
Constructor Details
-
StreamOperatorTable
public StreamOperatorTable(String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary) Constructor with specified symbols. Defining the lambda definition operatorx => x^2the range operator[1..5]the send to operatorx^2 -> yand whether the ternary operatorcode ? x : yis defined. The symbols list brackets and ternary operators are set in the properties file.- Parameters:
lambdaDefSymbol- string used to represent lambda definition operator, typically=>.rangeSymbol- string used to represent range operator, typically... If null then no range operator is added.sendToSymbol- string used to represent send to operator, typically->. If null then no send to operator is added.hasTernary- if true then a ternary conditional operator is added with symbol "cond ? :"
-
StreamOperatorTable
public StreamOperatorTable(String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary, FieldI field) Constructor with specified symbols. Defining the lambda definition operatorx => x^2the range operator[1..5]the send to operatorx^2 -> yand whether the ternary operatorcode ? x : yis defined. The symbols list brackets and ternary operators are set in the properties file.- Parameters:
lambdaDefSymbol- string used to represent lambda definition operator, typically=>.rangeSymbol- string used to represent range operator, typically... If null then no range operator is added.sendToSymbol- string used to represent send to operator, typically->. If null then no send to operator is added.hasTernary- if true then a ternary conditional operator is added with symbol "cond ? :"
-
StreamOperatorTable
public StreamOperatorTable(OperatorTable2 oldTable, String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary) A decorator constructor. Takes all the operators supplied in the oldTable and add extra bitwise operations.- Parameters:
oldTable- table with most operators.lambdaDefSymbol- string used to represent lambda definition operator, typically=>.rangeSymbol- string used to represent range operator, typically... If null then no range operator is added.sendToSymbol- string used to represent send to operator, typically->. If null then no send to operator is added.hasTernary- if true then a ternary conditional operator is added with symbol "cond ? :"
-
StreamOperatorTable
public StreamOperatorTable(OperatorTable2 oldTable, String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary, FieldI field) A decorator constructor. Takes all the operators supplied in the oldTable and add extra bitwise operations.- Parameters:
oldTable- table with most operators.lambdaDefSymbol- string used to represent lambda definition operator, typically=>.rangeSymbol- string used to represent range operator, typically... If null then no range operator is added.sendToSymbol- string used to represent send to operator, typically->. If null then no send to operator is added.hasTernary- if true then a ternary conditional operator is added with symbol "cond ? :"
-
StreamOperatorTable
-
-
Method Details
-
shallowCopy
Description copied from class:EmptyOperatorTableCreate a new version of this OperatorTable. Operators are copied into new table. However, Operators whose pfmc implement JepComponent are duplicated. This means the table could be used in a separate thread without problem. Subclasses should override with method to return a table of the correct type, a typical implementation would beusing the@Override public OperatorTableI shallowCopy() { Map<OperatorKey, Operator> map = this.threadSafeMapCopy(); return new MyOperatorTable(map); }EmptyOperatorTable.threadSafeMapCopy()method to return a copy of the map of operators and a constructor taking this map which uses theEmptyOperatorTable(Map)constructor.- Specified by:
shallowCopyin interfaceOperatorTableI- Overrides:
shallowCopyin classChainedOperatorTable- Returns:
- a new Table
-