edu.mit.sketch.system.constraints
Class ArithmaticExpression

java.lang.Object
  extended by edu.mit.sketch.system.constraints.ArithmaticExpression
Direct Known Subclasses:
AddExpression, DivExpression, IdentityExpression, MultExpression, NumberExpression, SubExpression

public abstract class ArithmaticExpression
extends java.lang.Object

Created: Tue May 28 16:59:45 2002
Copyright: Copyright (C) 2001 by MIT. All rights reserved.

Version:
$Id: ArithmaticExpression.html,v 1.3 2007-11-25 20:52:42 bpaulson Exp $
Author:
christine alvarado

Constructor Summary
ArithmaticExpression(java.util.List props)
           
 
Method Summary
abstract  ArithmaticExpression copy(java.util.Map objectBindings)
          Copy this ArithmaticExpression object but also copy the model properties.
 boolean equals(java.lang.Object o)
          Returns true if all the properties are the same and the two expressions evaluate to the same value.
 double evaluate()
          Perform some arithmatic operation on the values of the variables.
 java.util.List getProperties()
           
 java.util.List getUncalculatedProperties()
          Get the properties that still need values.
 int hashCode()
           
 boolean readyToEvaluate()
           
 void reset()
           
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArithmaticExpression

public ArithmaticExpression(java.util.List props)
Method Detail

reset

public void reset()

getUncalculatedProperties

public java.util.List getUncalculatedProperties()
Get the properties that still need values. I think it's easiest if these properties are just mutated outside this function, rather than passing their value back in.


readyToEvaluate

public boolean readyToEvaluate()

getProperties

public java.util.List getProperties()

copy

public abstract ArithmaticExpression copy(java.util.Map objectBindings)
Copy this ArithmaticExpression object but also copy the model properties.


evaluate

public final double evaluate()
Perform some arithmatic operation on the values of the variables. This makes sure they all have values first.


toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Returns true if all the properties are the same and the two expressions evaluate to the same value.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object