This class represents units formed by the product of rational powers of existing physical units.
This class maintains the canonical form of this product (simplest form after factorization). For example: METRE.pow(2).divide(METRE)
returns METRE.
| Modifier and Type | Class and Description |
|---|---|
| private static class | ProductUnit.
Inner product element represents a rational power of a single unit. |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final ProductUnit. | elements
Holds the units composing this product unit. |
| private transient Lazy | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ProductUnit(Unit<?>
the product unit source. productUnit)Copy constructor (allows for parameterization of product units). |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| public boolean | equals(Object
the reference object with which to compare. obj)Implements abstract tech. Indicates whether some other object is "equal to" this one. |
| private static int | Returns: the greatest common divisor.the first number. m, int n)Returns the greatest common divisor (Euclid's algorithm). |
| public Map | getBaseUnits()
Implements abstract tech. Implements javax. Returns the base units and their exponent whose product is this unit, or |
| public Dimension | getDimension()
Implements abstract tech. Implements javax. Returns the dimension of this unit. |
| private static Unit | Returns: the corresponding unit.left multiplicand elements. leftElems,right multiplicand elements. rightElemsReturns the unit defined from the product of the specified elements. |
| public UnitConverter | getSystemConverter()
Implements abstract tech. Returns the converter from this unit to its unscaled |
| public Unit | Returns: the unit element at the specified position.the index of the unit element to return. index)Returns the unit element at the specified position. |
| public int | Returns: the number of unit elements.Returns the number of unit elements in this product. |
| public int | Returns: the unit power exponent at the specified position.the index of the unit element. index)Returns the power exponent of the unit element at the specified position. |
| public int | Returns: the unit root exponent at the specified position.the index of the unit element. index)Returns the root exponent of the unit element at the specified position. |
| public int | hashCode()
Implements abstract tech. Returns a hash code value for this object. |
| public static Unit | |
| public static Unit | |
| public static Unit | Returns: dividend / divisorthe dividend unit operand. left, Unit<?> the divisor unit operand. right)Returns the quotient of the specified units. |
| public static Unit | |
| public Unit | pow(int
the exponent. n)Overrides tech. Implements javax. Returns a unit equals to this unit raised to an exponent. |
| private void | |
| public Unit | toSystemUnit()
Implements abstract tech. Returns the unscaled |
| private Object |
| elements | back to summary |
|---|---|
| private final ProductUnit. Holds the units composing this product unit.
| |
| hashCode | back to summary |
|---|---|
| private transient Lazy<Integer> hashCode | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ProductUnit | back to summary |
|---|---|
| public ProductUnit() DefaultQuantityFactory constructor (used solely to create | |
| ProductUnit | back to summary |
|---|---|
| public ProductUnit(Unit<?> productUnit) Copy constructor (allows for parameterization of product units).
| |
| ProductUnit | back to summary |
|---|---|
| private ProductUnit(ProductUnit. Product unit constructor.
| |
| calculateHashCode | back to summary |
|---|---|
| private int calculateHashCode() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Implements abstract tech. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| gcd | back to summary |
|---|---|
| private static int gcd(int m, int n) Returns the greatest common divisor (Euclid's algorithm).
| |
| getBaseUnits | back to summary |
|---|---|
| public Map Implements abstract tech. Implements javax. Doc from javax. Returns the base units and their exponent whose product is this unit, or | |
| getDimension | back to summary |
|---|---|
| public Dimension getDimension() Implements abstract tech. Implements javax. Doc from javax. Returns the dimension of this unit. Two units | |
| getInstance | back to summary |
|---|---|
| private static Unit Returns the unit defined from the product of the specified elements.
| |
| getSystemConverter | back to summary |
|---|---|
| public UnitConverter getSystemConverter() Implements abstract tech. Doc from tech. Returns the converter from this unit to its unscaled
| |
| getUnit | back to summary |
|---|---|
| public Unit Returns the unit element at the specified position.
| |
| getUnitCount | back to summary |
|---|---|
| public int getUnitCount() Returns the number of unit elements in this product.
| |
| getUnitPow | back to summary |
|---|---|
| public int getUnitPow(int index) Returns the power exponent of the unit element at the specified position.
| |
| getUnitRoot | back to summary |
|---|---|
| public int getUnitRoot(int index) Returns the root exponent of the unit element at the specified position.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract tech. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| ofPow | back to summary |
|---|---|
| public static Unit Returns the product unit corresponding to this unit raised to the specified exponent. | |
| ofProduct | back to summary |
|---|---|
| public static Unit Returns the product of the specified units. | |
| ofQuotient | back to summary |
|---|---|
| public static Unit Returns the quotient of the specified units. | |
| ofRoot | back to summary |
|---|---|
| public static Unit Returns the product unit corresponding to the specified root of the specified unit.
| |
| pow | back to summary |
|---|---|
| public Unit Overrides tech. Implements javax. Doc from tech. Returns a unit equals to this unit raised to an exponent. | |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream stream) throws InvalidObjectException | |
| toSystemUnit | back to summary |
|---|---|
| public Unit Implements abstract tech. Doc from tech. Returns the unscaled
| |
| writeReplace | back to summary |
|---|---|
| private Object writeReplace() | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | pow
Holds the power exponent. |
| private final int | root
Holds the root exponent. |
| private static final long | |
| private final Unit | unit
Holds the single unit. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public int | |
| public Unit | |
| public int |
| pow | back to summary |
|---|---|
| private final int pow Holds the power exponent. | |
| root | back to summary |
|---|---|
| private final int root Holds the root exponent. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| unit | back to summary |
|---|---|
| private final Unit<?> unit Holds the single unit. | |
| Element | back to summary |
|---|---|
| private Element(Unit<?> unit, int pow, int root) Structural constructor.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getPow | back to summary |
|---|---|
| public int getPow() Returns the power exponent. The power exponent can be negative but is always different from zero.
| |
| getRoot | back to summary |
|---|---|
| public int getRoot() Returns the root exponent. The root exponent is always greater than zero.
| |
| getUnit | back to summary |
|---|---|
| public Unit Returns this element's unit.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| private static int | |
| private static ProductUnit. |
| ElementUtil | back to summary |
|---|---|
| private ElementUtil() | |
| arrayEqualsArbitraryOrder | back to summary |
|---|---|
| private static boolean arrayEqualsArbitraryOrder(final ProductUnit. | |
| compare | back to summary |
|---|---|
| private static int compare(final ProductUnit. | |
| copyAndSort | back to summary |
|---|---|
| private static ProductUnit. | |
| Modifier and Type | Field and Description |
|---|---|
| private final ProductUnit. | |
| private static final long | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private Object |
| elements | back to summary |
|---|---|
| private final ProductUnit. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| symbol | back to summary |
|---|---|
| private final String symbol | |
| SerializationProxy | back to summary |
|---|---|
| private SerializationProxy(ProductUnit<?> productUnit) | |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |