package lab.art; /** * This class represents the variable x expression. * * @author Franck van Breugel */ public class VariableX extends Expression { /** * Initializes this variable x expression. */ public VariableX() { super(); } /** * Evaluates this variable x expression at the given x- and y-coordinate. * * @param x the x-coordinate. * @pre. x >= -1 && x <= 1 * @param y the y-coordinate. * @pre. y >= -1 && y <= 1 * @return the value of this variable x expression at the given x- and y-coordinate. */ public double evaluate(double x, double y) { return x; } /** * Returns a string representation of this variable x expression. * The string consists of "x". * * @return string representation of this variable x expression. */ public String toString() { return "x"; } }