All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.util.ThreadSafeCounter
java.lang.Object
|
+----ncsa.util.ThreadSafeCounter
- public class ThreadSafeCounter
- extends Object
ThreadSafeCounter
This counter will safely increment and return the next value,
even it simultaneously called from multiple threads.
-
ThreadSafeCounter()
-
-
ThreadSafeCounter(int)
-
-
next()
-
ThreadSafeCounter
public ThreadSafeCounter()
- Parameters:
- nInitialValue - where the counter starts counting from
ThreadSafeCounter
public ThreadSafeCounter(int nInitialValue)
- Parameters:
- nInitialValue - where the counter starts counting from
next
public synchronized int next()
- Returns:
- the next integer
All Packages Class Hierarchy This Package Previous Next Index