|
ProgramixGenericLib v5.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.programix.thread.BooleanState
public class BooleanState
This class serves as a thread-safe tracker of a boolean state.
Constructor Summary | |
---|---|
BooleanState()
Creates an instance that is initially false and synchronizes on itself. |
|
BooleanState(boolean initialState)
Creates an instance that is initially set to the state of initialState and synchronizes on itself. |
|
BooleanState(boolean initialState,
Object lockObject)
Creates an instance that is initially set to the state of initialState and synchronizes on the specified lockObject. |
|
BooleanState(boolean initialState,
Waiter waiter)
Creates an instance that is initially set to the state of initialState and synchronizes on the lock used by the specified waiter. |
|
BooleanState(Object lockObject)
Creates an instance that is initially false and synchronizes on the specified lockObject. |
Method Summary | |
---|---|
Object |
getLockObject()
|
Waiter |
getWaiter()
|
boolean |
ifFalseSetTrue()
If the current state is false, then the state is changed to true. |
boolean |
ifTrueSetFalse()
If the current state is true, then the state is changed to false. |
boolean |
isFalse()
Returns true if the internal state is currently false. |
boolean |
isShutdown()
|
boolean |
isTrue()
Returns true if the internal state is currently true. |
void |
setState(boolean newState)
Sets the internal state to the specified newState. |
void |
shutdown()
Called to shutdown all access to this counter and to dislodge any threads waiting on conditions. |
void |
toggleState()
Sets the internal state to the opposite of whatever is was before the call. |
void |
waitUntilFalse()
Waits until the state is false. |
void |
waitUntilFalse(long msTimeout)
Waits until the state is false up to the specified maximum amount of time. |
void |
waitUntilTrue()
Waits until the state is true. |
void |
waitUntilTrue(long msTimeout)
Waits until the state is true up to the specified maximum amount of time. |
void |
waitWhileFalse()
Waits while the state is false. |
void |
waitWhileFalse(long msTimeout)
Waits while the state is false up to the specified maximum amount of time. |
void |
waitWhileTrue()
Waits while the state is true. |
void |
waitWhileTrue(long msTimeout)
Waits while the state is true up to the specified maximum amount of time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BooleanState(boolean initialState, Waiter waiter)
public BooleanState(boolean initialState, Object lockObject)
public BooleanState(boolean initialState)
public BooleanState(Object lockObject)
public BooleanState()
Method Detail |
---|
public boolean isTrue() throws ShutdownException
ShutdownException
public boolean isFalse() throws ShutdownException
ShutdownException
public void setState(boolean newState) throws ShutdownException
ShutdownException
public void toggleState() throws ShutdownException
ShutdownException
public boolean ifTrueSetFalse() throws ShutdownException
ShutdownException
public boolean ifFalseSetTrue() throws ShutdownException
ShutdownException
public void waitWhileTrue(long msTimeout) throws TimedOutException, ShutdownException, InterruptException
TimedOutException
ShutdownException
InterruptException
public void waitWhileTrue() throws ShutdownException, InterruptException
ShutdownException
InterruptException
public void waitUntilTrue(long msTimeout) throws TimedOutException, ShutdownException, InterruptException
TimedOutException
ShutdownException
InterruptException
public void waitUntilTrue() throws ShutdownException, InterruptException
ShutdownException
InterruptException
public void waitWhileFalse(long msTimeout) throws TimedOutException, ShutdownException, InterruptException
TimedOutException
ShutdownException
InterruptException
public void waitWhileFalse() throws ShutdownException, InterruptException
ShutdownException
InterruptException
public void waitUntilFalse(long msTimeout) throws TimedOutException, ShutdownException, InterruptException
TimedOutException
ShutdownException
InterruptException
public void waitUntilFalse() throws ShutdownException, InterruptException
ShutdownException
InterruptException
public Waiter getWaiter()
public void shutdown()
public boolean isShutdown()
public Object getLockObject()
|
ProgramixGenericLib v5.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |