|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AsyncCount
A mutable counter that can be waited on for asynchronous value changes.
| Method Summary | |
|---|---|
void |
await(int value)
Blocks the calling thread until the count equals the given value. |
void |
await(int value,
long timeout,
TimeUnit unit)
Blocks the calling thread until the count equals the given value. |
void |
awaitGreater(int value)
Blocks the calling thread until the count is greater than the specified value. |
void |
awaitGreater(int value,
long timeout,
TimeUnit unit)
Blocks the calling thread until the count is greater than the specified value. |
void |
awaitLess(int value)
Blocks the calling thread until the count is less than the specified value. |
void |
awaitLess(int value,
long timeout,
TimeUnit unit)
Blocks the calling thread until the count is less than the specified value. |
int |
value()
|
| Method Detail |
|---|
int value()
void await(int value)
throws InterruptedException
value - The value of the count should to wait for.
InterruptedException - When the thread is interrupted.
void await(int value,
long timeout,
TimeUnit unit)
throws InterruptedException,
TimeoutException
By the time the thread returns, the count may have already changed again but it is guaranteed that the count was at least once equal the given value during the wait.
value - The value of the state to wait for.timeout - The maximum time to wait.unit - The time unit for the timeout.
InterruptedException - When the thread is interrupted.
TimeoutException - When the timeout elapses.
void awaitGreater(int value)
throws InterruptedException
value - The value to compare to.
InterruptedException - When the thread is interrupted.
void awaitGreater(int value,
long timeout,
TimeUnit unit)
throws InterruptedException,
TimeoutException
value - The value to compare to.timeout - The maximum time to wait.unit - The time unit for the timeout.
InterruptedException - When the thread is interrupted.
TimeoutException - When the timeout elapses.
void awaitLess(int value)
throws InterruptedException
value - he value to compare to.
InterruptedException - When the thread is interrupted.
void awaitLess(int value,
long timeout,
TimeUnit unit)
throws InterruptedException,
TimeoutException
value - he value to compare to.timeout - The maximum time to wait.unit - The time unit for the timeout.
InterruptedException - When the thread is interrupted.
TimeoutException - When the timeout elapses.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||