Class ValueUtils.ValueItemComparator

java.lang.Object
com.priint.pubserver.util.ValueUtils.ValueItemComparator
All Implemented Interfaces:
Comparator<ValueItem>
Enclosing class:
ValueUtils

public static class ValueUtils.ValueItemComparator extends Object implements Comparator<ValueItem>
  • Constructor Details

    • ValueItemComparator

      public ValueItemComparator()
  • Method Details

    • compare

      public int compare(ValueItem o1, ValueItem o2)
      This method compares the labels of the Values.
      Specified by:
      compare in interface 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.