T
- The type of those objects we want to count.public final class SlotBasedCounter<T> extends Object implements Serializable
Constructor and Description |
---|
SlotBasedCounter(int numSlots) |
Modifier and Type | Method and Description |
---|---|
long |
getCount(T obj,
int slot) |
Map<T,Long> |
getCounts() |
void |
incrementCount(T obj,
int slot) |
void |
wipeSlot(int slot)
Reset the slot count of any tracked objects to zero for the given slot.
|
void |
wipeZeros()
Remove any object from the counter whose total count is zero (to free up memory).
|
public void incrementCount(T obj, int slot)
public long getCount(T obj, int slot)
public void wipeSlot(int slot)
public void wipeZeros()
Copyright © 2023 The Apache Software Foundation. All rights reserved.