|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.transactional.refs.BasicRef<E>
public class BasicRef<E>
Basic Ref implementation. In most cases this is the
Ref implementation you want to use.
| Constructor Summary | |
|---|---|
BasicRef()
Creates a BasicRef with a null reference. |
|
BasicRef(E value)
Creates a new BasicRef with the provided reference. |
|
| Method Summary | |
|---|---|
E |
clear()
Clears the value and returns the old value (could be null). |
E |
get()
Gets the current value stored in this reference. |
E |
getOrAwait()
Gets the current non null value, or waits until a non null value comes available. |
E |
getOrAwaitInterruptibly()
Gets the current non null value, or waits until a non null value becomes available or until it is is Interrupted. |
boolean |
isNull()
Checks if the value is null. |
E |
set(E newValue)
Sets the new value value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BasicRef()
public BasicRef(E value)
value - the reference to store in this BasicRef.| Method Detail |
|---|
public final E getOrAwait()
Ref
getOrAwait in interface Ref<E>
public final E getOrAwaitInterruptibly()
throws InterruptedException
Ref
getOrAwaitInterruptibly in interface Ref<E>InterruptedException - if the thread is interrupted while waiting on a reference to come available.public final boolean isNull()
Ref
isNull in interface Ref<E>public final E get()
Ref
get in interface Ref<E>public final E set(E newValue)
Ref
set in interface Ref<E>newValue - the new value
public final E clear()
Ref
clear in interface Ref<E>public final String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||