Package adams.core

Class NamedCounter.CounterComparator

  • All Implemented Interfaces:
    Comparator<String>
    Enclosing class:
    NamedCounter

    public static class NamedCounter.CounterComparator
    extends Object
    implements Comparator<String>
    Comparator for sorting the names based on the counts associated with them.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_Counter

        protected NamedCounter m_Counter
        the basis for the comparison.
    • Constructor Detail

      • CounterComparator

        public CounterComparator​(NamedCounter counter)
        Initializes the comparator.
    • Method Detail

      • compare

        public int compare​(String o1,
                           String o2)
        Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

        Specified by:
        compare in interface Comparator<String>
        Parameters:
        o1 - the first object to be compared.
        o2 - the second object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.