|
JScience v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.physics.units.Unit<Q>
org.jscience.physics.units.DerivedUnit<Q>
org.jscience.physics.units.ProductUnit<Q>
public final class ProductUnit<Q extends Quantity>
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.times(Unit),
Unit.divide(Unit),
Unit.pow(int),
Unit.root(int),
Serialized Form| Nested Class Summary | |
|---|---|
static class |
ProductUnit.Element
Inner product element represents a rational power of a single unit. |
| Field Summary |
|---|
| Fields inherited from class org.jscience.physics.units.Unit |
|---|
ONE |
| Method Summary | |
|---|---|
protected boolean |
equalsImpl(java.lang.Object that)
Indicates if the specified unit can be considered equals to the one specified (for unicity purpose). |
ProductUnit.Element |
get(int index)
Returns the product element at the specified position. |
protected Unit<Q> |
getParentUnitImpl()
Returns the parent units this unit is derived from. |
protected int |
hashCodeImpl()
Returns the hash code for this unit (calculated only once as units are unique). |
int |
size()
Returns the number of units in this product. |
protected Converter |
toParentUnitImpl()
Returns the converter to the parent unit. |
| Methods inherited from class org.jscience.physics.units.Unit |
|---|
alias, alternate, compound, divide, equals, getBaseUnits, getConverterTo, getDimension, getInstance, getInstances, getParentUnit, hashCode, inverse, isCompatible, label, plus, pow, readResolve, root, times, times, toBaseUnits, toParentUnit, toString, toText, transform, valueOf |
| Methods inherited from class java.lang.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.
java.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index >= size()).protected boolean equalsImpl(java.lang.Object that)
Unit
equalsImpl in class Unit<Q extends Quantity>true if this unit is considered equal to
that unit; false otherwise.protected int hashCodeImpl()
Unit
hashCodeImpl in class Unit<Q extends Quantity>protected Unit<Q> getParentUnitImpl()
Unit
getParentUnitImpl in class Unit<Q extends Quantity>this if this unit is
a base unit or a product of base units.protected Converter toParentUnitImpl()
Unit
toParentUnitImpl in class Unit<Q extends Quantity>Unit.getParentUnitImpl()
|
JScience v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||