Class 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 Detail

      • UnitEquation

        public UnitEquation​(UnitExpr lhs,
                            UnitExpr rhs)
        Construct a UnitEquation from the left and right hand sides.
        Parameters:
        lhs - The left hand side.
        rhs - The right hand side.
    • 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 is
         Ex1, 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.