com.rubecula.units
Class BaseUnit
java.lang.Object
com.rubecula.util.Item
com.rubecula.units.BaseUnit
- All Implemented Interfaces:
- Auditable, java.lang.Comparable, Identifiable, Measurable, Presentable, java.io.Serializable
- Direct Known Subclasses:
- FlatUnit, SiUnit, UnitsFoundation
- public abstract class BaseUnit
- extends Item
- implements Measurable
This abstract class represents, in its most primitive form,
a unit of the Systeme International (SI).
Only the dimension (type) of unit is represented here.
- Version:
- $Revision: 1.1 $
- Author:
- Robin Hillyard
- See Also:
- Serialized Form
Method Summary |
(package private) boolean |
isEqual(Measurable other)
Method to determine if this BaseUnit is equivalent to that Measurable. |
boolean |
isInSystem(int sysIndex)
Method to determine if this Measurable is in a certain system of units. |
boolean |
isNumber()
Method to determine if this is dimensionless (i.e. unitless). |
boolean |
isParallel(Measurable that)
Method to determine if this Measurable is parallel to that Measurable. |
boolean |
isParallelInSystem(Measurable that,
SystemFlag system)
Method to determine if this Measurable is parallel to that Measurable
AND if this is in the system specified. |
Methods inherited from class com.rubecula.util.Item |
audit, audit, compareTo, Debug, getClassNameShort, getType, IsDebug, present, SetDebug, test, test, toString, Wrap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BaseUnit
public BaseUnit()
isInSystem
public boolean isInSystem(int sysIndex)
- Method to determine if this Measurable is in a certain system of units.
- Parameters:
sysIndex
- the index of the units system.
- Returns:
- true of this Measurable belongs to System defined by sysIndex.
isNumber
public boolean isNumber()
- Method to determine if this is dimensionless (i.e. unitless).
- Specified by:
isNumber
in interface Measurable
- Returns:
- true if not in any System.
isParallelInSystem
public boolean isParallelInSystem(Measurable that,
SystemFlag system)
- Method to determine if this Measurable is parallel to that Measurable
AND if this is in the system specified.
- Parameters:
that
- the Measurable to compare.system
- the system to which this must belong (or null if don't care).
- Returns:
- true if the Dimensions of the Measurables are the same,
i.e. if the Measurables differ only by a scale or offset.
isParallel
public boolean isParallel(Measurable that)
- Method to determine if this Measurable is parallel to that Measurable.
- Specified by:
isParallel
in interface Measurable
- Parameters:
that
- the Measurable to compare.
- Returns:
- true if the Dimensions of the Measurables are the same,
i.e. if the Measurables differ only by a scale or offset.
isEqual
boolean isEqual(Measurable other)
- Method to determine if this BaseUnit is equivalent to that Measurable.
- Parameters:
other
- the Measurable to compare.
- Returns:
- true if isParallel(other) and if their respective scales and
offsets are equal.