K - the key typepublic class ReferenceCounter<K>
extends java.lang.Object
| Constructor and Description |
|---|
ReferenceCounter() |
| Modifier and Type | Method and Description |
|---|---|
int |
add(K key)
Increases the reference count for the given key,
or sets it to 1 if the key has no existing count.
|
int |
remove(K key)
Decreases the reference count for the given key,
and removes it if it reaches 0.
|
public int add(K key)
key - a keypublic int remove(K key)
key - a keyData In Motion Consulting GmbH