com.kuka.nav
Interface AsyncCount


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

value

int value()
Returns:
The current state of the mutable count.

await

void await(int value)
           throws InterruptedException
Blocks the calling thread until the count equals the given value. Note that 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 to the given value during the wait.

Parameters:
value - The value of the count should to wait for.
Throws:
InterruptedException - When the thread is interrupted.

await

void await(int value,
           long timeout,
           TimeUnit unit)
           throws InterruptedException,
                  TimeoutException
Blocks the calling thread until the count equals the given value.

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.

Parameters:
value - The value of the state to wait for.
timeout - The maximum time to wait.
unit - The time unit for the timeout.
Throws:
InterruptedException - When the thread is interrupted.
TimeoutException - When the timeout elapses.

awaitGreater

void awaitGreater(int value)
                  throws InterruptedException
Blocks the calling thread until the count is greater than the specified value.

Parameters:
value - The value to compare to.
Throws:
InterruptedException - When the thread is interrupted.

awaitGreater

void awaitGreater(int value,
                  long timeout,
                  TimeUnit unit)
                  throws InterruptedException,
                         TimeoutException
Blocks the calling thread until the count is greater than the specified value.

Parameters:
value - The value to compare to.
timeout - The maximum time to wait.
unit - The time unit for the timeout.
Throws:
InterruptedException - When the thread is interrupted.
TimeoutException - When the timeout elapses.

awaitLess

void awaitLess(int value)
               throws InterruptedException
Blocks the calling thread until the count is less than the specified value.

Parameters:
value - he value to compare to.
Throws:
InterruptedException - When the thread is interrupted.

awaitLess

void awaitLess(int value,
               long timeout,
               TimeUnit unit)
               throws InterruptedException,
                      TimeoutException
Blocks the calling thread until the count is less than the specified value.

Parameters:
value - he value to compare to.
timeout - The maximum time to wait.
unit - The time unit for the timeout.
Throws:
InterruptedException - When the thread is interrupted.
TimeoutException - When the timeout elapses.


Copyright © 2019. All rights reserved.