|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jpeterson.util.Condition
Constructor Summary | |
Condition(boolean isTrue)
Create a new condition variable in a known state. |
Method Summary | |
boolean |
isTrue()
See if the condition variable is true (without releasing). |
void |
releaseAll()
Release all waiting threads without setting the condition true. |
void |
releaseOne()
Release one waiting thread without setting the condition true. |
void |
setFalse()
Set the condition to false. |
void |
setTrue()
Set the condition to true. |
void |
waitForTrue()
Wait (potentially forever) for the condition to become true. |
void |
waitForTrue(long timeout)
Wait for the condition to become true. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Condition(boolean isTrue)
Derived from Java World article
isTrue
- initial state of condition variableMethod Detail |
public boolean isTrue()
public void setFalse()
public void setTrue()
public void releaseAll()
public void releaseOne()
public void waitForTrue(long timeout) throws java.lang.InterruptedException
timeout
- Timeout in millisecondspublic void waitForTrue() throws java.lang.InterruptedException
timeout
- Timeout in milliseconds
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |