Class ValueUtils.ValueItemComparator

  • All Implemented Interfaces:
    java.util.Comparator<ValueItem>
    Enclosing class:
    ValueUtils

    public static class ValueUtils.ValueItemComparator
    extends java.lang.Object
    implements java.util.Comparator<ValueItem>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(ValueItem o1, ValueItem o2)
      This method compares the labels of the Values.
      • 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

      • ValueItemComparator

        public ValueItemComparator()
    • Method Detail

      • compare

        public int compare​(ValueItem o1,
                           ValueItem o2)
        This method compares the labels of the Values.
        Specified by:
        compare in interface java.util.Comparator<ValueItem>
        Parameters:
        o1 - first value item to be compared
        o2 - second value item to be compared
        Returns:
        if o1 or o1.label equals null, returns -1. If o2 or o2 label equals null, returns 1. If o1 & o2 or o1.label&o2.label equals null, returns 0; Otherwise: returns 0 if both labels are equal; a value less than 0 if this o1.label is lexicographically less than the o2.label; and a value greater than 0 if o1.label is lexicographically greater than o2.label.