de.kosi.util
Class WaitObject

java.lang.Object
  |
  +--de.kosi.util.WaitObject

public class WaitObject
extends java.lang.Object

WaitObject implements a meaning to wait for a number of events to happen (barrier). The object is created with a number of calls, that have to o ccur. After that, the method waitForCalls returns.

ChangeLog:

 $Log: WaitObject.java,v $
 Revision 1.3  2001/05/22 20:24:40  jiriki
 Made source more conformant to Coding Conventions.

 Revision 1.2  2001/05/09 19:59:18  jiriki
 Removed Bug 422755.

 Revision 1.1.1.1  2001/04/29 18:05:19  jiriki
 Imported sources from zola.

 Revision 1.2  2001/04/11 17:40:49  wombat
 Updated Documentation.

 

Version:
$Revision: 1.3 $ ($Date: 2001/05/22 20:24:40 $)
Author:
Niklas Mehner

Constructor Summary
WaitObject(int numCalls)
          Create a new WaitObject.
 
Method Summary
 void call()
          Make a call to the WaitObject.
 boolean isFinished()
          Returns if this waitObject has finished waiting.
 void waitForCalls()
          Wait until call has been called numCalls times, and return after that.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaitObject

public WaitObject(int numCalls)
Create a new WaitObject.
Parameters:
numCalls - Number of calls to call that have to be made.
Method Detail

waitForCalls

public void waitForCalls()
Wait until call has been called numCalls times, and return after that. This method blocks until all calls have arrived.

isFinished

public boolean isFinished()
Returns if this waitObject has finished waiting. After a call to waitForCalls() this should always be true. A call to this method is non-blocking.
Returns:
true If this waitObject has finished waiting.

call

public void call()
Make a call to the WaitObject.