public final class UnitSet extends java.lang.Object implements java.lang.Cloneable
Modified by: Joseph A. Huwaldt
Modifier and Type | Class and Description |
---|---|
static class |
UnitSet.SetType
The different unit set types in this collection.
|
static class |
UnitSet.UnitSystem
The type of unit system being used.
|
Modifier and Type | Field and Description |
---|---|
static Unit |
DEG
The angular unit "degree".
|
static Unit |
RAD
The angular unit "radian".
|
Constructor and Description |
---|
UnitSet(UnitSet.UnitSystem system)
Construct a coherent set of units based on the system identification provided.
|
Modifier and Type | Method and Description |
---|---|
Unit<Acceleration> |
acceleration()
Return the acceleration units.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l) |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener l) |
Unit<Angle> |
angle()
Return the angular measure units for this unit set.
|
Unit<AngularVelocity> |
angularVelocity()
Return the angular velocity units.
|
Unit<Area> |
area()
Return the area units.
|
void |
clearPropertyChangeListeners() |
java.lang.Object |
clone()
Creates and returns a copy of this object.
|
boolean |
equals(java.lang.Object obj)
Compares this UnitSet against the specified object for strict equality.
|
Unit<Force> |
force()
Return the force units.
|
static Unit[] |
getSet(UnitSet.SetType type)
Returns an array of units of the specified type (array of related units).
|
UnitSet.UnitSystem |
getSystem()
Method that returns the Unit System for this unit set.
|
int |
hashCode()
Returns the hash code for this UnitSet.
|
Unit<Inertia> |
inertia()
Return the inertia units.
|
boolean |
isCoherent()
Return
true if this unit set is coherent. |
boolean |
isConsistent()
Return
true if this unit set is consistent. |
Unit<Length> |
length()
Return the length units for this unit set.
|
void |
makeConsistent()
Makes this unit set consistent by deriving a complete set of units for this
application based on the fundamental or base units of time, length, mass and angle.
|
Unit<Mass> |
mass()
Return the mass units for this unit set.
|
Unit<VolumetricDensity> |
massDensity()
Return the mass density units.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l) |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener l) |
void |
setAngle(Unit<Angle> unit)
Method used to set the angular measure units in this unit set.
|
void |
setLength(Unit<Length> unit)
Method used to set the length units in this unit set.
|
void |
setMass(Unit<Mass> unit)
Method used to set the mass units in this unit set.
|
void |
setTime(Unit<Duration> unit)
Method used to set the time units in this unit set.
|
Unit<Duration> |
time()
Return the duration of time units for this unit set.
|
Unit<Torque> |
torque()
Return the torque units.
|
Unit<Velocity> |
velocity()
Return the velocity units.
|
Unit<Volume> |
volume()
Return the volume units.
|
public UnitSet(UnitSet.UnitSystem system)
system
- The Unit System type.public UnitSet.UnitSystem getSystem()
public static Unit[] getSet(UnitSet.SetType type)
type
- The unit type to return an array of units for.public boolean isCoherent()
true
if this unit set is coherent. Coherent means that the
derived units in this set are a product of powers of base units with no other
proportionality factor than one.isConsistent()
public boolean isConsistent()
true
if this unit set is consistent. Consistent means that the
derived units are made up of powers of the base units though there may be
conversion factors involved.makeConsistent()
,
isCoherent()
public void makeConsistent()
isConsistent()
,
isCoherent()
public Unit<Duration> time()
public void setTime(Unit<Duration> unit) throws ConversionException
unit
- the time unit to set this unit set to.ConversionException
- if the provided unit is not compatible with time
(seconds).makeConsistent()
public Unit<Length> length()
public void setLength(Unit<Length> unit) throws ConversionException
unit
- the length unit to set this unit set to.ConversionException
- if the provided unit is not compatible with length
(meters).makeConsistent()
public void setMass(Unit<Mass> unit) throws ConversionException
unit
- the mass unit to set this unit set to.ConversionException
- if the provided unit is not compatible with mass (kg).makeConsistent()
public Unit<Angle> angle()
public void setAngle(Unit<Angle> unit) throws ConversionException
unit
- the angle unit to set this unit set to.ConversionException
- if the provided unit is not compatible with angles (radian).makeConsistent()
public Unit<Acceleration> acceleration()
public Unit<VolumetricDensity> massDensity()
public Unit<AngularVelocity> angularVelocity()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare with.true
if this UnitSet is identical to that object;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
public void clearPropertyChangeListeners()