Class ProductUnit.Element

java.lang.Object
tech.units.indriya.unit.ProductUnit.Element
All Implemented Interfaces:
Serializable
Enclosing class:
ProductUnit<Q extends javax.measure.Quantity<Q>>

private static final class ProductUnit.Element extends Object implements Serializable
Inner product element represents a rational power of a single unit.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    Holds the power exponent.
    private final int
    Holds the root exponent.
    private static final long
     
    private final javax.measure.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

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns the power exponent.
    int
    Returns the root exponent.
    javax.measure.Unit<?>
    Returns this element's unit.
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • 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.
  • Constructor Details

    • Element

      private Element(javax.measure.Unit<?> unit, int pow, int root)
      Structural constructor.
      Parameters:
      unit - the unit.
      pow - the power exponent.
      root - the root exponent.
  • Method Details

    • 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(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object