All Packages Class Hierarchy This Package Previous Next Index
Class ajanta.pattern.Counter
java.lang.Object
|
+----ajanta.pattern.Counter
- public class Counter
- extends Object
- implements Serializable
It is a Synchronizer for SplitJoinAll and SpliJoinAny object.
It is a simple counter implementing a barrier.
- See Also:
- SplitJoinAll, SplitJoinAny
-
Counter()
-
-
decrement()
- It decrements the value of the counter and if the value of
the counter is not zero then it makes caller to execute wait()
call else it notifyAll().
-
setValue(int)
- Sets the value of the counter to the value passed as argument
Counter
public Counter()
setValue
public void setValue(int v)
- Sets the value of the counter to the value passed as argument
- Parameters:
- v - initial value of the counter
decrement
public synchronized void decrement()
- It decrements the value of the counter and if the value of
the counter is not zero then it makes caller to execute wait()
call else it notifyAll().
All Packages Class Hierarchy This Package Previous Next Index