|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.actorsguildframework.ImmediateResult<T>
T - the type of the resultpublic final class ImmediateResult<T>
ImmediateResult is an AsyncResult implementation that can be used when the result is already available. It is the easiest and most common way to implement the return value in a Message method.
Actor.result(Object),
Actor.noResult(),
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.actorsguildframework.AsyncResult |
|---|
AsyncResult.Notifier<T> |
| Constructor Summary | |
|---|---|
ImmediateResult(T value)
Creates a new ImmediateResult instance with the given result value. |
|
| Method Summary | |
|---|---|
void |
addNotifier(AsyncResult.Notifier<T> notifier)
Adds a notifier. |
void |
await()
Does nothing, as the result is always ready in this implementation. |
T |
get()
Returns the value immediately, as the result is always ready in this implementation. |
Throwable |
getException()
This implementation will always return null. |
boolean |
isReady()
Always returns true, as the result is always ready in this implementation. |
void |
removeNotifier(AsyncResult.Notifier<T> notifier)
Adds a notifier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImmediateResult(T value)
Actor, which offers the
convenient helper function @{link Actor#result(Object)} to create new instances.
value - the result valueActor.result(Object)| Method Detail |
|---|
public T get()
get in interface AsyncResult<T>AsyncResult.await(),
AsyncResult.addNotifier(org.actorsguildframework.AsyncResult.Notifier)public void await()
await in interface AsyncResult<T>AsyncResult.addNotifier(org.actorsguildframework.AsyncResult.Notifier),
AsyncResult.isReady(),
DefaultAgent.awaitAll(AsyncResult...),
DefaultAgent.awaitAny(AsyncResult...)public boolean isReady()
isReady in interface AsyncResult<T>AsyncResult.await()public void addNotifier(AsyncResult.Notifier<T> notifier)
addNotifier in interface AsyncResult<T>notifier - the notifier to add
IllegalArgumentException - if the argument was nullAsyncResult.removeNotifier(org.actorsguildframework.AsyncResult.Notifier)public void removeNotifier(AsyncResult.Notifier<T> notifier)
removeNotifier in interface AsyncResult<T>notifier - the notifier to remove
IllegalArgumentException - if the argument was nullAsyncResult.addNotifier(org.actorsguildframework.AsyncResult.Notifier)public Throwable getException()
getException in interface AsyncResult<T>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||