cz.cuni.amis.utils.flag
Class FlagInteger

java.lang.Object
  extended by cz.cuni.amis.utils.flag.Flag<java.lang.Integer>
      extended by cz.cuni.amis.utils.flag.FlagInteger
All Implemented Interfaces:
IFlag<java.lang.Integer>, java.io.Serializable

public class FlagInteger
extends Flag<java.lang.Integer>
implements java.io.Serializable

This class is cruicial in order to have synchronized increments on the integer flag.

The .setFlag() mechanism is very complex and it is sometimes not viable to do .setFlag() call inside synchronized statements (deadlocks!) therefore we have to solve it inside the class.

See Also:
Serialized Form

Nested Class Summary
static class FlagInteger.DoInSyncWithReason<T,R>
          This class extends the DoInSync of the reason that was passed along.
 
Nested classes/interfaces inherited from class cz.cuni.amis.utils.flag.Flag
Flag.DoInSync<T>
 
Constructor Summary
FlagInteger(java.lang.Integer initial)
           
 
Method Summary
 void decrement(int number)
           
 void increment(int number)
           
 
Methods inherited from class cz.cuni.amis.utils.flag.Flag
addListener, addStrongListener, clearListeners, defreeze, freeze, getFlag, getImmutable, inSync, inSyncInner, isFrozen, isListenning, isNone, isOne, removeAllListeners, removeListener, setFlag, waitFor, waitFor, waitForChange, waitForChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlagInteger

public FlagInteger(java.lang.Integer initial)
Method Detail

increment

public void increment(int number)

decrement

public void decrement(int number)