Package ptolemy.moml.unit
Class UnitEquation
- java.lang.Object
-
- ptolemy.moml.unit.UnitConstraint
-
- ptolemy.moml.unit.UnitEquation
-
- All Implemented Interfaces:
UnitPresentation
public class UnitEquation extends UnitConstraint implements UnitPresentation
A Unit equation is a particular type of Unit constraint, another type being a Unit inequality.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Rowland R Johnson
- Pt.AcceptedRating:
- Red (rowland)
- Pt.ProposedRating:
- Red (rowland)
-
-
Constructor Summary
Constructors Constructor Description UnitEquation(UnitExpr lhs, UnitExpr rhs)
Construct a UnitEquation from the left and right hand sides.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areSatisfied(java.util.Vector equations)
Return true if the equations are all satisfied.UnitEquation
canonicalize()
Transform to the canonical form of the equation.UnitEquation
copy()
Make a copy where the left and right sides are alos copied.boolean
isSatisfied()
Return true if this equation is satisfied.java.lang.Object
visit(EquationVisitor visitor)
Visit this Unit equation (on the way to visiting the leaves)-
Methods inherited from class ptolemy.moml.unit.UnitConstraint
descriptiveForm, getLhs, getOperator, getRhs, getSource, setLhs, setRhs, setSource, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.moml.unit.UnitPresentation
descriptiveForm, toString
-
-
-
-
Method Detail
-
areSatisfied
public static boolean areSatisfied(java.util.Vector equations)
Return true if the equations are all satisfied.- Parameters:
equations
- The equations.- Returns:
- True if the equations are all satisfied.
-
canonicalize
public UnitEquation canonicalize()
Transform to the canonical form of the equation. The canonical form of an equation isEx1, Ex2, ..., Exn = A
where each Exi is a Unit term containing only one variable, and A is a Unit term containing one Unit and no variables.- Returns:
- unitEquation The UnitEquation in canonical form.
-
copy
public UnitEquation copy()
Make a copy where the left and right sides are alos copied.- Returns:
- The copy.
-
isSatisfied
public boolean isSatisfied()
Return true if this equation is satisfied.- Returns:
- True if this equation is satisfied.
-
visit
public java.lang.Object visit(EquationVisitor visitor) throws IllegalActionException
Visit this Unit equation (on the way to visiting the leaves)- Parameters:
visitor
- The visitor.- Returns:
- Whatever may be returned by the visitor.
- Throws:
IllegalActionException
- Not thrown in this base class.
-
-