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.


Constructor Index

 o ThreadSafeCounter()
 o ThreadSafeCounter(int)

Method Index

 o next()

Constructors

 o ThreadSafeCounter
 public ThreadSafeCounter()
Parameters:
nInitialValue - where the counter starts counting from
 o ThreadSafeCounter
 public ThreadSafeCounter(int nInitialValue)
Parameters:
nInitialValue - where the counter starts counting from

Methods

 o next
 public synchronized int next()
Returns:
the next integer

All Packages  Class Hierarchy  This Package  Previous  Next  Index