Documentation of 'org.jfree.data.KeyedValueComparator' Java class
KeyedValueComparator
org.jfree.data

Class KeyedValueComparator

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Comparator


    public class KeyedValueComparator
    extends java.lang.Object
    implements java.util.Comparator, java.io.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compare(java.lang.Object o1, java.lang.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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • KeyedValueComparator

        public KeyedValueComparator(KeyedValueComparatorType type,
                                    org.jfree.util.SortOrder order)
        Creates a new comparator.
        Parameters:
        type - the type (BY_KEY or BY_VALUE, null not permitted).
        order - the order (null not permitted).
    • Method Detail

      • getOrder

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

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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.