Class KeyedValueComparator

java.lang.Object
org.jfree.data.KeyedValueComparator
All Implemented Interfaces:
Serializable, Comparator

public class KeyedValueComparator
extends Object
implements Comparator, Serializable
A utility class that can compare and order two KeyedValue instances and sort them into ascending or descending order by key or by value.
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • getType

      Returns the type.
      Returns:
      The type (never null).
    • getOrder

      public SortOrder getOrder()
      Returns the sort order.
      Returns:
      The sort order (never null).
    • compare

      public int compare​(Object o1, Object o2)
      Compares two KeyedValue instances and returns an int that indicates the relative order of the two objects.
      Specified by:
      compare in interface Comparator
      Parameters:
      o1 - object 1.
      o2 - object 2.
      Returns:
      An int indicating the relative order of the objects.