public class Negator extends Object implements UnaryOperator
Constructor and Description |
---|
Negator()
Creates a new negator.
|
Modifier and Type | Method and Description |
---|---|
Value |
applyTo(Expression operand)
Returns the negation of the operand's value.
|
String |
getIdentifier()
Returns the operator's string identirifer.
|
Value.Type |
getOperandValueType()
Returns the type of value that the operator's operands can have.
|
boolean |
isPrefix()
Returns whether the operator is a prefix operator, i.e. it appears
before its operand.
|
String |
toString() |
public Negator()
public Value applyTo(Expression operand) throws IllegalValueTypeException
applyTo
in interface UnaryOperator
IllegalValueTypeException
- if the value of the operand is not numericpublic String getIdentifier()
Operator
getIdentifier
in interface Operator
public boolean isPrefix()
UnaryOperator
isPrefix
in interface UnaryOperator
public Value.Type getOperandValueType()
Operator
getOperandValueType
in interface Operator