Package net.i2p.util

Class ObjectCounter<K>

java.lang.Object
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 Details

  • Method Details

    • 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. Reset the count for all keys to zero.
      Since:
      0.7.11
    • clear

      public void clear​(K h)
      Reset the count for this key to zero
      Since:
      0.9.36