net.i2p.util
Class ObjectCounter<K>

java.lang.Object
  extended by net.i2p.util.ObjectCounter<K>
All Implemented Interfaces:
Serializable

public class ObjectCounter<K>
extends Object
implements Serializable

Count things.

Author:
zzz, welterde
See Also:
Serialized Form

Constructor Summary
ObjectCounter()
           
 
Method Summary
 void clear()
          start over
 int count(K h)
           
 int increment(K h)
          Add one.
 Set<K> objects()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCounter

public ObjectCounter()
Method Detail

increment

public int increment(K h)
Add one.

Returns:
count after increment

count

public int count(K h)
Returns:
current count

objects

public Set<K> objects()
Returns:
set of objects with counts > 0

clear

public void clear()
start over

Since:
0.7.11