public static class ThreadGate.ThreadLocalCounter extends ThreadLocal<Long>
This class associates a single Long value with the current thread. The Long value may be retrieved, set, removed, incremented, or decremented.
Constructor and Description |
---|
ThreadLocalCounter()
Create a new ThreadLocalCounter with an initial Long value of zero.
|
Modifier and Type | Method and Description |
---|---|
long |
decrement()
Decrement the Long value of the ThreadLocalCounter for the current thread by one.
|
long |
increment()
Increment the Long value of the ThreadLocalCounter for the current thread by one.
|
protected Long |
initialValue() |
get, remove, set, withInitial
public ThreadLocalCounter()
public long increment()
decrement()
public long decrement()
increment()
protected Long initialValue()
initialValue
in class ThreadLocal<Long>