org.egothor.util
Class Counter

java.lang.Object
  extended by org.egothor.util.Counter

public class Counter
extends java.lang.Object

This class is part of the Egothor Project

Author:
Leo Galambos

Constructor Summary
Counter(int counter)
          Constructor for the Counter object.
 
Method Summary
 void down()
          Subtract 1 from the Counter's value.
 void up()
          Add 1 to the Counter's value.
 void waitFor0()
          Lock the calling thread until this Counter's value is 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Counter

public Counter(int counter)
Constructor for the Counter object.

Parameters:
counter - the Counter's initial value
Method Detail

up

public void up()
Add 1 to the Counter's value.


down

public void down()
Subtract 1 from the Counter's value.


waitFor0

public void waitFor0()
Lock the calling thread until this Counter's value is 0.