Class Abs
- java.lang.Object
-
- picasso.parser.language.ExpressionTreeNode
-
- picasso.parser.language.expressions.UnaryFunction
-
- picasso.parser.language.expressions.Abs
-
- All Implemented Interfaces:
EvaluatableExpression
public class Abs extends UnaryFunction
Represents the absolute value function in the Picasso language.
-
-
Field Summary
-
Fields inherited from class picasso.parser.language.ExpressionTreeNode
gelementsToValue
-
-
Constructor Summary
Constructors Constructor Description Abs(ExpressionTreeNode param)
Create an absolute value expression with the given parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RGBColor
evaluate(double x, double y)
Evaluates this expression at the given x,y point by taking the absolute value of the function's parameter.-
Methods inherited from class picasso.parser.language.expressions.UnaryFunction
equals, toString
-
-
-
-
Constructor Detail
-
Abs
public Abs(ExpressionTreeNode param)
Create an absolute value expression with the given parameter.- Parameters:
param
- the expression whose absolute value will be taken
-
-
Method Detail
-
evaluate
public RGBColor evaluate(double x, double y)
Evaluates this expression at the given x,y point by taking the absolute value of the function's parameter.- Specified by:
evaluate
in interfaceEvaluatableExpression
- Specified by:
evaluate
in classExpressionTreeNode
- Parameters:
x
- the x-coordinate at which to evaluatey
- the y-coordinate at which to evaluate- Returns:
- the color resulting from evaluating the absolute value of the parameter
-
-