Class AbstractOperator
java.lang.Object
com.igormaznitsa.jcp.expression.operators.AbstractOperator
- All Implemented Interfaces:
ExpressionItem
- Direct Known Subclasses:
OperatorADD
,OperatorAND
,OperatorDIV
,OperatorEQU
,OperatorGREAT
,OperatorGREATEQU
,OperatorLESS
,OperatorLESSEQU
,OperatorMOD
,OperatorMUL
,OperatorNOT
,OperatorNOTEQU
,OperatorOR
,OperatorSUB
,OperatorXOR
The class is the base for all operator handlers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AbstractOperator[]
The array contains all operators allowed by the preprocessorstatic final String
The constant is the prefix for executing methods of operators -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends AbstractOperator>
EfindForClass
(Class<E> operatorClass) Find an operator handler for its classabstract int
getArity()
Get the operator arityGet the expression item typeabstract String
Get the operator keywordabstract String
Get the operator reference to be shown for a help information requesttoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.igormaznitsa.jcp.expression.ExpressionItem
getExpressionItemPriority
-
Field Details
-
EXECUTION_PREFIX
The constant is the prefix for executing methods of operators- See Also:
-
ALL_OPERATORS
The array contains all operators allowed by the preprocessor
-
-
Constructor Details
-
AbstractOperator
public AbstractOperator()
-
-
Method Details
-
findForClass
Find an operator handler for its class- Type Parameters:
E
- the handler class extends AbstractOperator- Parameters:
operatorClass
- the class to be used for search, must not be null- Returns:
- an instance of the handler or null if there is not any such one
-
getExpressionItemType
Get the expression item type- Specified by:
getExpressionItemType
in interfaceExpressionItem
- Returns:
- for operators it is always ExpressionItemType.OPERATOR
-
getArity
public abstract int getArity()Get the operator arity- Returns:
- the operator arity (1 or 2)
-
getKeyword
Get the operator keyword- Returns:
- the operator keyword, must not be null
-
getReference
Get the operator reference to be shown for a help information request- Returns:
- the operator reference as a String, must not be null
-
toString
-