Package adams.core
Class NamedCounter.CounterComparator
- java.lang.Object
-
- adams.core.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 Summary
Fields Modifier and Type Field Description protected NamedCounter
m_Counter
the basis for the comparison.
-
Constructor Summary
Constructors Constructor Description CounterComparator(NamedCounter counter)
Initializes the comparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(String o1, String o2)
Compares its two arguments for order.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
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 interfaceComparator<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.
-
-