csheets.core.formula
Class UnaryOperation
java.lang.Object
csheets.core.formula.Operation<UnaryOperator>
csheets.core.formula.UnaryOperation
- All Implemented Interfaces:
- Expression, Serializable
public class UnaryOperation
- extends Operation<UnaryOperator>
A unary operation in a formula.
- Author:
- Einar Pehrson
- See Also:
- Serialized Form
UnaryOperation
public UnaryOperation(UnaryOperator operator,
Expression operand)
- Creates a new unary operation.
- Parameters:
operator - the unary operatoroperand - the operand
evaluate
public Value evaluate()
throws IllegalValueTypeException
- Description copied from interface:
Expression
- Evaluates the expression and returns the result.
- Returns:
- the result of the evaluation
- Throws:
IllegalValueTypeException - if a value of an unexpected type was
encountered when evaluating the expression
getOperand
public Expression getOperand()
- Returns the operand.
- Returns:
- an expression tree representing the operand
accept
public Object accept(ExpressionVisitor visitor)
- Description copied from interface:
Expression
- Accepts to visit the given expression visitor.
- Parameters:
visitor - the visitor
toString
public String toString()
- Overrides:
toString in class Object