public class KeyedValueComparator extends Object implements Comparator, Serializable
KeyedValue
instances
and sort them into ascending or descending order by key or by value.Constructor and Description |
---|
KeyedValueComparator(KeyedValueComparatorType type,
org.jfree.util.SortOrder order)
Creates a new comparator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2)
Compares two
KeyedValue instances and returns an
int that indicates the relative order of the two objects. |
org.jfree.util.SortOrder |
getOrder()
Returns the sort order.
|
KeyedValueComparatorType |
getType()
Returns the type.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public KeyedValueComparator(KeyedValueComparatorType type, org.jfree.util.SortOrder order)
type
- the type (BY_KEY
or BY_VALUE
,
null
not permitted).order
- the order (null
not permitted).public KeyedValueComparatorType getType()
null
).public org.jfree.util.SortOrder getOrder()
null
).public int compare(Object o1, Object o2)
KeyedValue
instances and returns an
int
that indicates the relative order of the two objects.compare
in interface Comparator
o1
- object 1.o2
- object 2.Jas4pp 1.5 © Java Analysis Studio for Particle Physics