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 abs function in the Picasso language. Computes the absolute value of each RGB color component.
-
-
Field Summary
-
Fields inherited from class picasso.parser.language.ExpressionTreeNode
gelementsToValue
-
-
Constructor Summary
Constructors Constructor Description Abs(ExpressionTreeNode param)Creates a Abs expression that wraps the given parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RGBColorevaluate(double x, double y)Evaluates this expression by taking the abs value of each component of the parameters evaluated color.-
Methods inherited from class picasso.parser.language.expressions.UnaryFunction
equals, toString
-
-
-
-
Constructor Detail
-
Abs
public Abs(ExpressionTreeNode param)
Creates a Abs expression that wraps the given parameter.- Parameters:
param- the expression whose value should be absolute valued
-
-
Method Detail
-
evaluate
public RGBColor evaluate(double x, double y)
Evaluates this expression by taking the abs value of each component of the parameters evaluated color.- 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
-
-