Package net.sourceforge.plantuml.evalex
Class AbstractLazyOperator
- java.lang.Object
-
- net.sourceforge.plantuml.evalex.AbstractLazyOperator
-
- All Implemented Interfaces:
LazyOperator
- Direct Known Subclasses:
AbstractOperator
public abstract class AbstractLazyOperator extends java.lang.Object implements LazyOperator
Abstract implementation of an operator.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
booleanOperator
Whether this operator is boolean or not.protected boolean
leftAssoc
Operator is left associative.protected java.lang.String
oper
This operators name (pattern).protected int
precedence
Operators precedence.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLazyOperator(java.lang.String oper, int precedence, boolean leftAssoc)
Creates a new operator.protected
AbstractLazyOperator(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 java.lang.String
getOper()
Gets the String that is used to denote the operator in the expression.int
getPrecedence()
Gets the precedence value of this operator.boolean
isBooleanOperator()
Gets whether this operator evaluates to a boolean expression.boolean
isLeftAssoc()
Gets whether this operator is left associative (true
) or if this operator is right associative (false
).-
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
eval
-
-
-
-
Constructor Detail
-
AbstractLazyOperator
protected AbstractLazyOperator(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.
-
AbstractLazyOperator
protected AbstractLazyOperator(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
-
getOper
public java.lang.String getOper()
Description copied from interface:LazyOperator
Gets the String that is used to denote the operator in the expression.- Specified by:
getOper
in interfaceLazyOperator
- Returns:
- The String that is used to denote the operator in the expression.
-
getPrecedence
public int getPrecedence()
Description copied from interface:LazyOperator
Gets the precedence value of this operator.- Specified by:
getPrecedence
in interfaceLazyOperator
- Returns:
- the precedence value of this operator.
-
isLeftAssoc
public boolean isLeftAssoc()
Description copied from interface:LazyOperator
Gets whether this operator is left associative (true
) or if this operator is right associative (false
).- Specified by:
isLeftAssoc
in interfaceLazyOperator
- Returns:
true
if this operator is left associative.
-
isBooleanOperator
public boolean isBooleanOperator()
Description copied from interface:LazyOperator
Gets whether this operator evaluates to a boolean expression.- Specified by:
isBooleanOperator
in interfaceLazyOperator
- Returns:
true
if this operator evaluates to a boolean expression.
-
-