|
Secure iNet Factory | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jscape.util.BooleanLock
public final class BooleanLock
The boolean lock. Used for thread synchronization.
| Field Summary | |
|---|---|
static int |
INFINITE_TIMEOUT
The infinite timeout value. |
| Constructor Summary | |
|---|---|
BooleanLock()
Creates a new lock instance initialized with false value. |
|
BooleanLock(boolean initialValue)
Creates a new lock instance. |
|
| Method Summary | |
|---|---|
boolean |
isFalse()
Checks if the current lock value is false. |
boolean |
isTrue()
Checks if the current lock value is true. |
void |
setValue(boolean newValue)
Sets value to the lock. |
boolean |
testAndSet(boolean value)
|
boolean |
waitToSetFalse()
Waits until the lock value is true and sets it to
false. |
boolean |
waitToSetFalse(long msTimeout)
Waits until the lock value is true and sets it to
false. |
boolean |
waitToSetTrue()
Waits until the lock value is false and sets it
to true. |
boolean |
waitToSetTrue(long msTimeout)
Waits until the lock value is false and sets it
to true. |
boolean |
waitUntilFalse()
Waits until the lock value is false. |
boolean |
waitUntilFalse(long msTimeout)
Waits until the lock value is false. |
boolean |
waitUntilStateIs(boolean state)
Waits until the lock value is in specified state. |
boolean |
waitUntilStateIs(boolean state,
long msTimeout)
Waits until the lock value is in specified state. |
boolean |
waitUntilTrue()
Waits until the lock value is true. |
boolean |
waitUntilTrue(long msTimeout)
Waits until the lock value is true. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int INFINITE_TIMEOUT
| Constructor Detail |
|---|
public BooleanLock(boolean initialValue)
initialValue - the initial valuepublic BooleanLock()
false value.
| Method Detail |
|---|
public boolean isTrue()
true.
true if the lock value is true;
false otherwisepublic boolean isFalse()
false.
true if the lock value is false;
false otherwisepublic void setValue(boolean newValue)
newValue - the new valuepublic boolean waitToSetTrue(long msTimeout)
false and sets it
to true.
msTimeout - the timeout value
true if lock value is set to true;
false if timeout occurspublic boolean waitToSetTrue()
false and sets it
to true.
true if lock value is set to true;
false if timeout occurspublic boolean waitToSetFalse(long msTimeout)
true and sets it to
false.
msTimeout - the timeout value
true if lock value is set to false;
false if timeout occurspublic boolean waitToSetFalse()
true and sets it to
false.
true if lock value is set to false;
false if timeout occurspublic boolean waitUntilTrue(long msTimeout)
true.
msTimeout - the timeout value
true if lock value is set to true;
false if timeout occurspublic boolean waitUntilTrue()
true.
true if lock value is set to true;
false if timeout occurspublic boolean waitUntilFalse(long msTimeout)
false.
msTimeout - the timeout value
true if lock value is set to false;
false if timeout occurspublic boolean waitUntilFalse()
false.
true if lock value is set to false;
false if timeout occurs
public boolean waitUntilStateIs(boolean state,
long msTimeout)
state - the target statemsTimeout - the timeout value
true if lock value is set to the specified state;
false if timeout occurspublic boolean waitUntilStateIs(boolean state)
state - the target state
true if lock value is set to the specified state;
false if timeout occurspublic boolean testAndSet(boolean value)
|
Secure iNet Factory | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||