Class BinaryOperator
- java.lang.Object
-
- picasso.parser.language.ExpressionTreeNode
-
- picasso.parser.language.expressions.BinaryOperator
-
- All Implemented Interfaces:
EvaluatableExpression
- Direct Known Subclasses:
Addition,Division,Exponentiate,Mod,Multiplication,PerlinBW,PerlinColor,Subtraction
public abstract class BinaryOperator extends ExpressionTreeNode
Represents an binary operation that takes two argument.
-
-
Field Summary
-
Fields inherited from class picasso.parser.language.ExpressionTreeNode
gelementsToValue
-
-
Constructor Summary
Constructors Constructor Description BinaryOperator(ExpressionTreeNode left, ExpressionTreeNode right)Creates an operator with the given left and right operands.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)abstract RGBColorevaluate(double x, double y)Evaluate this expression, given x and yStringtoString()Returns the string representation of the operator in the format ": "
-
-
-
Constructor Detail
-
BinaryOperator
public BinaryOperator(ExpressionTreeNode left, ExpressionTreeNode right)
Creates an operator with the given left and right operands.- Parameters:
left- the left operandright- the right operand
-
-
Method Detail
-
evaluate
public abstract RGBColor evaluate(double x, double y)
Description copied from class:ExpressionTreeNodeEvaluate this expression, given x and y- Specified by:
evaluatein interfaceEvaluatableExpression- Specified by:
evaluatein classExpressionTreeNode- Parameters:
x- the value of xy- the value of y- Returns:
- the result of evaluating the expression for the given values of x and y
-
toString
public String toString()
Returns the string representation of the operator in the format ": " - Overrides:
toStringin classObject- See Also:
Object.toString()
-
-