Class NaturalQuantityComparator<T extends javax.measure.Quantity<T>>

  • All Implemented Interfaces:
    java.util.Comparator<javax.measure.Quantity<T>>

    public class NaturalQuantityComparator<T extends javax.measure.Quantity<T>>
    extends java.lang.Object
    implements java.util.Comparator<javax.measure.Quantity<T>>
    Comparator to sort quantities by natural order, looking both the unit and the value.
    Since:
    2.0
    Version:
    1.0.1
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(javax.measure.Quantity<T> q1, javax.measure.Quantity<T> q2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • NaturalQuantityComparator

        public NaturalQuantityComparator()
    • Method Detail

      • compare

        public int compare​(javax.measure.Quantity<T> q1,
                           javax.measure.Quantity<T> q2)
        Specified by:
        compare in interface java.util.Comparator<T extends javax.measure.Quantity<T>>