Package com.priint.pubserver.util
Class ValueUtils.ValueItemComparator
java.lang.Object
com.priint.pubserver.util.ValueUtils.ValueItemComparator
- All Implemented Interfaces:
Comparator<ValueItem>
- Enclosing class:
- ValueUtils
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ValueItemComparator
public ValueItemComparator()
-
-
Method Details
-
compare
This method compares the labels of the Values.- Specified by:
comparein interfaceComparator<ValueItem>- Parameters:
o1- first value item to be comparedo2- 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.
-