Package net.sourceforge.plantuml.evalex
Class AbstractOperator
- java.lang.Object
-
- net.sourceforge.plantuml.evalex.AbstractLazyOperator
-
- net.sourceforge.plantuml.evalex.AbstractOperator
-
- All Implemented Interfaces:
LazyOperator
,Operator
- Direct Known Subclasses:
AbstractUnaryOperator
,Expression.Operator
public abstract class AbstractOperator extends AbstractLazyOperator implements Operator
Abstract implementation of an operator.
-
-
Field Summary
-
Fields inherited from class net.sourceforge.plantuml.evalex.AbstractLazyOperator
booleanOperator, leftAssoc, oper, precedence
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOperator(java.lang.String oper, int precedence, boolean leftAssoc)
Creates a new operator.protected
AbstractOperator(java.lang.String oper, int precedence, boolean leftAssoc, boolean booleanOperator)
Creates a new operator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression.LazyNumber
eval(Expression.LazyNumber v1, Expression.LazyNumber v2)
Implementation for this operator.-
Methods inherited from class net.sourceforge.plantuml.evalex.AbstractLazyOperator
getOper, getPrecedence, isBooleanOperator, isLeftAssoc
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.plantuml.evalex.LazyOperator
getOper, getPrecedence, isBooleanOperator, isLeftAssoc
-
-
-
-
Constructor Detail
-
AbstractOperator
protected AbstractOperator(java.lang.String oper, int precedence, boolean leftAssoc, boolean booleanOperator)
Creates a new operator.- Parameters:
oper
- The operator name (pattern).precedence
- The operators precedence.leftAssoc
-true
if the operator is left associative, elsefalse
.booleanOperator
- Whether this operator is boolean.
-
AbstractOperator
protected AbstractOperator(java.lang.String oper, int precedence, boolean leftAssoc)
Creates a new operator.- Parameters:
oper
- The operator name (pattern).precedence
- The operators precedence.leftAssoc
-true
if the operator is left associative, elsefalse
.
-
-
Method Detail
-
eval
public Expression.LazyNumber eval(Expression.LazyNumber v1, Expression.LazyNumber v2)
Description copied from interface:LazyOperator
Implementation for this operator.- Specified by:
eval
in interfaceLazyOperator
- Parameters:
v1
- Operand 1.v2
- Operand 2.- Returns:
- The result of the operation.
-
-