/** * Override of hashCode method. * * @return a hash code value for this subtract expression. */ public int hashCode() { int result = 23; result = (37 * result) + getExpression1().hashCode(); result = (37 * result) + getExpression2().hashCode(); return result; }
public String toString() { return "(" + getExpression1().toString() + "-" + getExpression2().toString() + ")"; } }
/** * Compares this expression to the specified object. Returns true if the * * @param obj - the object to compare this expression against. * @return true if specified object is equal to this expression; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof SubtractImpl) { SubtractImpl other = (SubtractImpl) obj; return Utilities.equals(getExpression1(), other.getExpression1()) && Utilities.equals(getExpression2(), other.getExpression2()); } else { return false; } } /**
public Object evaluate(Object feature) throws IllegalArgumentException { ensureOperandsSet(); double leftDouble = Filters.number(getExpression1().evaluate(feature)); double rightDouble = Filters.number(getExpression2().evaluate(feature)); return number(leftDouble - rightDouble); }
/** * Override of hashCode method. * * @return a hash code value for this subtract expression. */ public int hashCode() { int result = 23; result = (37 * result) + getExpression1().hashCode(); result = (37 * result) + getExpression2().hashCode(); return result; }
/** * Override of hashCode method. * * @return a hash code value for this subtract expression. */ public int hashCode() { int result = 23; result = (37 * result) + getExpression1().hashCode(); result = (37 * result) + getExpression2().hashCode(); return result; }
public String toString() { return "(" + getExpression1().toString() + "-" + getExpression2().toString()+ ")"; }
public String toString() { return "(" + getExpression1().toString() + "-" + getExpression2().toString()+ ")"; }
/** * Compares this expression to the specified object. Returns true if the * * @param obj - the object to compare this expression against. * * @return true if specified object is equal to this expression; false * otherwise. */ public boolean equals(Object obj) { if (obj instanceof SubtractImpl) { SubtractImpl other = (SubtractImpl) obj; return Utilities.equals(getExpression1(),other.getExpression1()) && Utilities.equals(getExpression2(),other.getExpression2()); } else { return false; } } /**
/** * Compares this expression to the specified object. Returns true if the * * @param obj - the object to compare this expression against. * * @return true if specified object is equal to this expression; false * otherwise. */ public boolean equals(Object obj) { if (obj instanceof SubtractImpl) { SubtractImpl other = (SubtractImpl) obj; return Utilities.equals(getExpression1(),other.getExpression1()) && Utilities.equals(getExpression2(),other.getExpression2()); } else { return false; } } /**
public Object evaluate(Object feature) throws IllegalArgumentException { ensureOperandsSet(); double leftDouble = Filters.number( getExpression1().evaluate(feature) ); double rightDouble = Filters.number( getExpression2().evaluate(feature) ); return number(leftDouble - rightDouble); }
public Object evaluate(Object feature) throws IllegalArgumentException { ensureOperandsSet(); double leftDouble = Filters.number( getExpression1().evaluate(feature) ); double rightDouble = Filters.number( getExpression2().evaluate(feature) ); return number(leftDouble - rightDouble); }