Class 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()  
      • Methods inherited from class java.lang.Object

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

      • 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 Detail

      • 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 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object