edu.jas.util
Class Terminator

java.lang.Object
  extended by edu.jas.util.Terminator

public class Terminator
extends java.lang.Object

Terminating helper class. Like a barrier, but with coming and going.

Author:
Heinz Kredel

Constructor Summary
Terminator(int workers)
          Terminator.
 
Method Summary
 void allIdle()
          allIdle.
 void beIdle()
          beIdle.
 boolean hasJobs()
          hasJobs.
 void notIdle()
          notIdle.
 void waitDone()
          wait done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Terminator

public Terminator(int workers)
Terminator.

Parameters:
workers - number of expected threads.
Method Detail

beIdle

public void beIdle()
beIdle.


allIdle

public void allIdle()
allIdle.


notIdle

public void notIdle()
notIdle.


hasJobs

public boolean hasJobs()
hasJobs.

Returns:
true, if there are possibly jobs, else false.

waitDone

public void waitDone()
wait done.