// $Id: ExprNegation.java,v 1.2 2002/09/04 18:06:08 leavens Exp leavens $
// Com S 362 homework

/** Expressions that are the negation of their argument, like -3. */
public class ExprNegation extends ExprSum {

    /** Initialize this expression tree. */
    public ExprNegation(ExprSum arg) {
        super(arg, null);
    }

    /** Return the value of this expression. */
    public double value() {
        return - left_arg.value();
    }

    /** Negations don't support isLessThan. */
    public boolean isLessThan() {
        throw new UnsupportedOperationException();
    }
}
