Package com.gengoai.parsing
Class UnaryOperatorExpression
- java.lang.Object
-
- com.gengoai.parsing.BaseExpression
-
- com.gengoai.parsing.UnaryOperatorExpression
-
- All Implemented Interfaces:
Expression
,Serializable
public class UnaryOperatorExpression extends BaseExpression
AnExpression
unary operator which contains a single expression value- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static PostfixHandler
POSTFIX_OPERATOR_HANDLER
Generic Handler for generatingUnaryOperatorExpression
s for postfix operators.static PrefixHandler
PREFIX_OPERATOR_HANDLER
Generic Handler for generatingUnaryOperatorExpression
s for prefix operators usingParser.parseExpression()
* to generate the value of the operator.
-
Constructor Summary
Constructors Constructor Description UnaryOperatorExpression(ParserToken token, Expression value, boolean isPrefix)
Instantiates a new Prefix operator expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getOperator()
Gets operator.Expression
getValue()
Gets theExpression
representing the value of the operator.int
hashCode()
boolean
isPrefix()
Is prefix boolean.String
toString()
-
Methods inherited from class com.gengoai.parsing.BaseExpression
getType
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.gengoai.parsing.Expression
apply, as, isInstance, isInstance, isInstance, when, when
-
-
-
-
Field Detail
-
POSTFIX_OPERATOR_HANDLER
public static PostfixHandler POSTFIX_OPERATOR_HANDLER
Generic Handler for generatingUnaryOperatorExpression
s for postfix operators.
-
PREFIX_OPERATOR_HANDLER
public static PrefixHandler PREFIX_OPERATOR_HANDLER
Generic Handler for generatingUnaryOperatorExpression
s for prefix operators usingParser.parseExpression()
* to generate the value of the operator.
-
-
Constructor Detail
-
UnaryOperatorExpression
public UnaryOperatorExpression(ParserToken token, Expression value, boolean isPrefix)
Instantiates a new Prefix operator expression.- Parameters:
token
- the tokenvalue
- the valueisPrefix
- the is prefix
-
-
Method Detail
-
getOperator
public String getOperator()
Gets operator.- Returns:
- the operator
-
getValue
public Expression getValue()
Gets theExpression
representing the value of the operator.- Returns:
- the value
-
isPrefix
public boolean isPrefix()
Is prefix boolean.- Returns:
- the boolean
-
-