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 StringThe 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 intgetArity()Get the operator arityGet the expression item typeabstract StringGet the operator keywordabstract StringGet the operator reference to be shown for a help information requesttoString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:
getExpressionItemTypein 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
-