|
Java Units API Build 2004-02-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Unit DerivedUnit ProductUnit
This class represents a product unit. Product units are formed by the product of rational powers of existing units.
This class maintains the canonical form of this product (simplest
form after factorization). For example:
METER.pow(2).divide(METER)
returns
METER
.
Unit.multiply(Unit)
,
Unit.divide(Unit)
,
Unit.pow(int)
,
Unit.root(int)
,
Serialized FormNested Class Summary | |
static class |
ProductUnit.Element
Inner product element represents a rational power of a single unit. |
Field Summary |
Fields inherited from class Unit |
ONE |
Method Summary | |
boolean |
equals(Object that)
Indicates if this unit is equal to the object specified. |
ProductUnit.Element |
get(int index)
Returns the product element at the specified position. |
Unit |
getSystemUnit()
Returns the system unit for this unit. |
int |
size()
Returns the number of units in this product. |
Methods inherited from class Unit |
add, alternate, appendTo, divide, getConverterTo, getDimension, getInstance, getInstances, hashCode, isCompatible, isSystemUnit, multiply, multiply, pow, readResolve, root, searchSymbol, toString, valueOf |
Methods inherited from class Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public int size()
public ProductUnit.Element get(int index)
index
- the index of the element to return.
IndexOutOfBoundsException
- if index is out of range
(index < 0 || index >= size())
.public Unit getSystemUnit()
Unit
Note: Having the same system units is not sufficient to ensure that a converter exists between the two units (e.g. °C/m and K/m).
getSystemUnit
in class Unit
Unit.isSystemUnit()
public boolean equals(Object that)
Unit
==
to test for equality.
equals
in class Unit
that
- the object to compare for equality.
true
if this unit and the specified object are
considered equal; false
otherwise.
|
Java Units API Build 2004-02-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Symbols, terms and definitions | JSR-108 project |