wyvern.util
Class Counter.Count

java.lang.Object
  extended bywyvern.util.Counter.Count
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
Counter

public static final class Counter.Count
extends java.lang.Object
implements java.lang.Comparable

Keeps track of an object and its count.


Method Summary
 int compareTo(java.lang.Object o)
          Compares us to another Count object.
 int getCount()
          Returns the number of occurrences of the key.
 java.lang.Object getKey()
          Returns the key for this counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getKey

public java.lang.Object getKey()
Returns the key for this counter.


getCount

public int getCount()
Returns the number of occurrences of the key.


compareTo

public int compareTo(java.lang.Object o)
Compares us to another Count object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the object to compare to
Returns:
1, 0 or -1 if we're <, = or > than other. (Backwards from normal compareTo because TreeSet sorts in ascending order, and we want descending order).