|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.util.ItemCounter<T>
T
- public final class ItemCounter<T>
Non Thread-Safe Counter of things. It allows to count items without worrying about nulls.
Constructor Summary | |
---|---|
ItemCounter()
|
Method Summary | |
---|---|
void |
add(T item,
long delta)
Add delta to the item |
boolean |
equals(Object o)
|
long |
get(T item)
Get current counter for an item item |
long |
getAndSet(T item,
long value)
Set counter for item and return previous value |
int |
hashCode()
|
void |
reset()
Reset state of the counter to 0. |
void |
set(T item,
long value)
Set counter of item to value |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ItemCounter()
Method Detail |
---|
public long get(T item)
item
-
public void set(T item, long value)
item
- to set set the value forvalue
- a new valuepublic void add(T item, long delta)
item
- delta
- public void reset()
public long getAndSet(T item, long value)
item
- value
-
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |