ca.infoway.messagebuilder.j5goodies
Class Tally<T extends Comparable<T>>

Package class diagram package Tally
java.lang.Object
  extended by ca.infoway.messagebuilder.j5goodies.Tally<T>
Type Parameters:
T - - the type of thing being counted
All Implemented Interfaces:
Comparable<Tally<T>>

public class Tally<T extends Comparable<T>>
extends Object
implements Comparable<Tally<T>>

A class that provides a final tally of counted items. Used with the Counter class to keep a running count of items.

Author:
Intelliware Development

Method Summary
 int compareTo(Tally<T> o)
          Comparison method.
 int getCount()
          Get the final count.
 T getKey()
          The value being counted.
 String toString()
          Standard debug string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCount

public int getCount()

Get the final count.

Returns:
- the count of items

getKey

public T getKey()

The value being counted.

Returns:
- the value

compareTo

public int compareTo(Tally<T> o)

Comparison method.

Specified by:
compareTo in interface Comparable<Tally<T extends Comparable<T>>>
Parameters:
o - - the item being compared
Returns:
- the comparison value, per the Comparator standards

toString

public String toString()

Standard debug string.

Overrides:
toString in class Object
Returns:
- the string


Copyright © 2013. All Rights Reserved.