Class KeyedValueComparator

    • 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​(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.