public class UnitExpr extends java.lang.Object implements UnitPresentation
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
_isFlat |
(package private) java.util.Vector |
_uTerms |
Constructor and Description |
---|
UnitExpr()
Construct an empty (i.e. no UnitTerms) UnitExpr.
|
UnitExpr(IOPort ioPort)
Construct a UnitTerm from an IOPort.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_setUTerms(java.util.Vector uTerms) |
void |
addUnitTerm(UnitTerm uTerm)
Add a UnitTerm to the expression.
|
UnitExpr |
copy()
Create a copy of this UnitExpr.
|
java.lang.String |
descriptiveForm()
The expression of the UnitExpr that is commonly used by humans.
|
Unit |
getSingleUnit()
If this UnitExpr has one term and it is a Unit then return that Unit.
|
java.util.Vector |
getUTerms()
Get the UnitTerms in this UnitExpr.
|
UnitExpr |
invert()
Create a new UnitExpr that is the inverse of this UnitExpr.
|
UnitExpr |
reduce()
Reduce a UnitExpr to produce a UnitExpr that has at most one Unit.
|
java.lang.String |
toString() |
public UnitExpr()
public UnitExpr(IOPort ioPort)
ioPort
- The IOPort.public void addUnitTerm(UnitTerm uTerm)
uTerm
- The UnitTerm.public UnitExpr copy()
public java.lang.String descriptiveForm()
descriptiveForm
in interface UnitPresentation
UnitPresentation.descriptiveForm()
public Unit getSingleUnit()
public java.util.Vector getUTerms()
public UnitExpr invert()
public UnitExpr reduce()
public java.lang.String toString()
toString
in interface UnitPresentation
toString
in class java.lang.Object
protected void _setUTerms(java.util.Vector uTerms)