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

Constructor Index

 o Counter()

Method Index

 o 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().
 o setValue(int)
Sets the value of the counter to the value passed as argument

Constructors

 o Counter
 public Counter()

Methods

 o 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
 o 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