Package tech.units.indriya.unit
Class ProductUnit.Element
- java.lang.Object
-
- tech.units.indriya.unit.ProductUnit.Element
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- ProductUnit<Q extends javax.measure.Quantity<Q>>
private static final class ProductUnit.Element extends java.lang.Object implements java.io.SerializableInner product element represents a rational power of a single unit.
-
-
Field Summary
Fields Modifier and Type Field Description private intpowHolds the power exponent.private introotHolds the root exponent.private static longserialVersionUIDprivate javax.measure.Unit<?>unitHolds the single unit.
-
Constructor Summary
Constructors Modifier Constructor Description privateElement(javax.measure.Unit<?> unit, int pow, int root)Structural constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)intgetPow()Returns the power exponent.intgetRoot()Returns the root exponent.javax.measure.Unit<?>getUnit()Returns this element's unit.inthashCode()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
unit
private final javax.measure.Unit<?> unit
Holds the single unit.
-
pow
private final int pow
Holds the power exponent.
-
root
private final int root
Holds the root exponent.
-
-
Method Detail
-
getUnit
public javax.measure.Unit<?> getUnit()
Returns this element's unit.- Returns:
- the single unit.
-
getPow
public int getPow()
Returns the power exponent. The power exponent can be negative but is always different from zero.- Returns:
- the power exponent of the single unit.
-
getRoot
public int getRoot()
Returns the root exponent. The root exponent is always greater than zero.- Returns:
- the root exponent of the single unit.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-