Class RangeOperator
java.lang.Object
com.singularsys.jep.Operator
com.singularsys.jep.configurableparser.RangeOperator
- All Implemented Interfaces:
PrintVisitor.PrintRulesI,Serializable
Operators like
[ x .. y ] with three symbols.
To add the operator use
OperatorTable2 optab = new StandardOperatorTable2();
Operator rangeOp = new RangeOperator("..", "[", "]", new Range(), Operator.BINARY+Operator.NOT_IN_PARSER);
optab.insertOperator(OperatorTable2.SpecialOperators.RANGE , rangeOp, optab.getAssign());
ConfigurableParser cp = new ConfigurableParserWithRange("..");
Jep jep = new Jep(cp,optab);
- Since:
- Jep 4.1
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.Operator
ASSOCIATIVE, BINARY, COMMUTATIVE, COMPOSITE, EQUIVALENCE, flags, key, LEFT, name, NARY, NO_ARGS, NOT_IN_PARSER, pfmc, precedence, PREFIX, printSymbol, REFLEXIVE, RIGHT, SELF_INVERSE, SUFFIX, symbol, SYMMETRIC, TERNARY, TRANSITIVE, UNARY, USE_BINDING_FOR_PRINT -
Constructor Summary
ConstructorsConstructorDescriptionRangeOperator(String name, String leftBracket, String rightBracket, PostfixMathCommandI pfmc, int flags) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(Node node, PrintVisitor pv) Prints the node in the formLeftBracket leftChild name rightChild rightBracketMethods inherited from class com.singularsys.jep.Operator
addAltSymbol, duplicate, getAltSymbols, getBinaryInverseOp, getBinding, getFlags, getInverseOp, getKey, getName, getPFMC, getPrecedence, getPrintSymbol, getRootOp, getSymbol, isAssociative, isBinary, isCommutative, isComposite, isDistributiveOver, isEquivalence, isLeftBinding, isNary, isPrefix, isReflexive, isRightBinding, isSelfInverse, isSuffix, isSymmetric, isTernary, isTransitive, isUnary, notInParser, numArgs, setBinaryInverseOp, setDistributiveOver, setFlag, setInverseOp, setKey, setPFMC, setPrecedence, setPrintSymbol, setRootOp, setSymbol, toFullString, toString, useBindingForPrint
-
Constructor Details
-
RangeOperator
public RangeOperator(String name, String leftBracket, String rightBracket, PostfixMathCommandI pfmc, int flags) Constructor- Parameters:
name- the name of operator and symbol in middle of operator.leftBracket- left-hand bracketrightBracket- right-hand bracketpfmc- function to implement the behaviourflags- flags for operator
-
-
Method Details
-
append
Prints the node in the formLeftBracket leftChild name rightChild rightBracket- Specified by:
appendin interfacePrintVisitor.PrintRulesI- Parameters:
node- the node to printpv- the PrintVisitor- Throws:
JepException- on error
-
getLeftBracket
-
getRightBracket
-