Public Member Functions | |
void | await () throws InterruptedException |
boolean | await (long timeout, TimeUnit unit) throws InterruptedException |
boolean | equals (Object obj) |
T | get () |
T | set (T value) |
Static Public Member Functions | |
static< T > Holder< T > | newEmpty () |
Private Member Functions | |
Holder () | |
Private Attributes | |
final CountDownLatch | latch |
T | value |
A mutable object that may contain a value to another object. It is modifiable exactly once and must hold a non-null value when the value is inspected.
Holders are intended for receiving a result from an anonymous class.
Note that Holder is not thread safe. For a thread safe implementation, use AtomicReference. Also note that two different Holder instances are never considered equal.
Definition at line 39 of file Holder.java.
org.ros.concurrent.Holder< T >.Holder | ( | ) | [inline, private] |
Definition at line 49 of file Holder.java.
void org.ros.concurrent.Holder< T >.await | ( | ) | throws InterruptedException [inline] |
Definition at line 66 of file Holder.java.
boolean org.ros.concurrent.Holder< T >.await | ( | long | timeout, |
TimeUnit | unit | ||
) | throws InterruptedException [inline] |
Definition at line 70 of file Holder.java.
boolean org.ros.concurrent.Holder< T >.equals | ( | Object | obj | ) | [inline] |
Definition at line 75 of file Holder.java.
T org.ros.concurrent.Holder< T >.get | ( | ) | [inline] |
Definition at line 61 of file Holder.java.
Definition at line 45 of file Holder.java.
T org.ros.concurrent.Holder< T >.set | ( | T | value | ) | [inline] |
Definition at line 54 of file Holder.java.
final CountDownLatch org.ros.concurrent.Holder< T >.latch [private] |
Definition at line 41 of file Holder.java.
T org.ros.concurrent.Holder< T >.value [private] |
Definition at line 43 of file Holder.java.