cad.simcad.worldsimulator.engine
Class IntegerSemaphor

java.lang.Object
  |
  +--cad.simcad.worldsimulator.engine.IntegerSemaphor
All Implemented Interfaces:
java.io.Serializable

public class IntegerSemaphor
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  int state
          This vlaue represents the internal state of this semaphor.
 
Constructor Summary
IntegerSemaphor()
          Creates new IntegerSemaphor
 
Method Summary
 int getValue()
          This method returns the state of the semaphore at the moment.
 void setValue(int val)
          This method changes the state of the semaphor to the given value.
 void waitForChange()
          This method blocks until anybody else changed the state of this semaphor.
 void waitForValue(int val)
          This method blocks until anybody else changed the state of this semaphor to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

protected int state
This vlaue represents the internal state of this semaphor.

Constructor Detail

IntegerSemaphor

public IntegerSemaphor()
Creates new IntegerSemaphor

Method Detail

setValue

public void setValue(int val)
This method changes the state of the semaphor to the given value.


getValue

public int getValue()
This method returns the state of the semaphore at the moment.


waitForChange

public void waitForChange()
This method blocks until anybody else changed the state of this semaphor.


waitForValue

public void waitForValue(int val)
This method blocks until anybody else changed the state of this semaphor to the given value.


Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be