|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.utils.flag.WaitForFlagChange<TYPE>
TYPE
- public class WaitForFlagChange<TYPE>
This class is implementing the waiting on some flag value.
Note that you may call only one AWAIT() at time.
Typical usage:
boolean flagValue = new WaitForFlagChange<Boolean>(booleanFlag, Boolean.TRUE).await();
int flagValue = new WaitForFlagChange<Integer>(integerFlag, new Integer[]{1,3}).await();
Nested Class Summary | |
---|---|
static interface |
WaitForFlagChange.IAccept<TYPE>
|
Constructor Summary | |
---|---|
WaitForFlagChange(IFlag<TYPE> flag)
Wait for the next flag change. |
|
WaitForFlagChange(IFlag<TYPE> flag,
Collection<TYPE> waitingFor)
|
|
WaitForFlagChange(IFlag<TYPE> flag,
TYPE waitingFor)
|
|
WaitForFlagChange(IFlag<TYPE> flag,
TYPE[] waitingFor)
|
|
WaitForFlagChange(IFlag<TYPE> flag,
WaitForFlagChange.IAccept<TYPE> waitingFor)
|
Method Summary | |
---|---|
TYPE |
await()
Note that you may call only await() from one thread! If the instance is already in used it may produce unwanted behavior (e.g. |
TYPE |
await(long timeout,
TimeUnit timeUnit)
Note that you may call only await() from one thread! If the instance is already in used it may produce unwanted behavior. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WaitForFlagChange(IFlag<TYPE> flag)
flag
- public WaitForFlagChange(IFlag<TYPE> flag, WaitForFlagChange.IAccept<TYPE> waitingFor)
public WaitForFlagChange(IFlag<TYPE> flag, TYPE waitingFor)
public WaitForFlagChange(IFlag<TYPE> flag, TYPE[] waitingFor)
public WaitForFlagChange(IFlag<TYPE> flag, Collection<TYPE> waitingFor)
Method Detail |
---|
public TYPE await() throws PogamutInterruptedException
InterruptedException
PogamutInterruptedException
public TYPE await(long timeout, TimeUnit timeUnit) throws PogamutInterruptedException
Returns null if desired value hasn't been set at the flag before timeout.
timeout
- timeUnit
-
PogamutInterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |