Class 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.
    • 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:
        evaluate in interface EvaluatableExpression
        Specified by:
        evaluate in class ExpressionTreeNode
        Parameters:
        x - the value of x
        y - the value of y
        Returns:
        the result of evaluating the expression for the given values of x and y