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.Serializable
Inner product element represents a rational power of a single unit.
-
-
Field Summary
Fields Modifier and Type Field Description private int
pow
Holds the power exponent.private int
root
Holds the root exponent.private static long
serialVersionUID
private javax.measure.Unit<?>
unit
Holds the single unit.
-
Constructor Summary
Constructors Modifier Constructor Description private
Element(javax.measure.Unit<?> unit, int pow, int root)
Structural constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getPow()
Returns the power exponent.int
getRoot()
Returns the root exponent.javax.measure.Unit<?>
getUnit()
Returns this element's unit.int
hashCode()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-