|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.ref.LocalResolver
The arrowhead facet of a local promise for resolving the outcome of the promise.
Field Summary | |
private FlexList |
myOptBuf
Until the promise is done, this holds the buffer of all messages sent to far. |
private Ref |
myOptRef
Once it's done, it stops pointing at the Ref. |
Constructor Summary | |
(package private) |
LocalResolver(Ref sRef,
FlexList buf)
Makes (what should be) the one resolver for resolving sRef. |
Method Summary | |
boolean |
isDone()
Enabled: If not isDone(), both resolveRace(java.lang.Object) and smash(java.lang.Throwable) will
work and return true, and resolve(java.lang.Object) will work rather than
throw an exception. |
void |
resolve(Object target)
Enabled: Like resolveRace(java.lang.Object) , but throws an exception to report that
this Resolver was already resolved, rather than returning a boolean. |
boolean |
resolveRace(Object target)
Enabled: Queues all accumulated and future messages for delivery to target, and, for example, a local promise becomes resolved into being E-equivalent to the target. |
boolean |
smash(Throwable problem)
Enabled: Breaks the promise, reporting 'problem' as the reason. |
String |
toString()
Suppressed: Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Ref myOptRef
private FlexList myOptBuf
Constructor Detail |
LocalResolver(Ref sRef, FlexList buf)
Method Detail |
public boolean resolveRace(Object target)
Resolver
If this resolver already Resolver.isDone()
, resolveRace(..) has no
effect and returns false. Otherwise, the promise (or whatever) becomes
resolved, this Resolver becomes done, and resolveRace(..) returns true.
In either case, a Resolver will be isDone() following a resolveRace(..).
resolveRace
in interface Resolver
target
-
public void resolve(Object target)
Resolver
Resolver.resolveRace(java.lang.Object)
, but throws an exception to report that
this Resolver was already resolved, rather than returning a boolean.
Successful return indicates successful reslution.
resolve
in interface Resolver
target
- public boolean smash(Throwable problem)
Resolver
"r.smash(p)" is equivalent to "r.resolveRace(Ref.broken(p))".
smash
in interface Resolver
Resolver.resolveRace(java.lang.Object)
public boolean isDone()
Resolver
Resolver.resolveRace(java.lang.Object)
and Resolver.smash(java.lang.Throwable)
will
work and return true, and Resolver.resolve(java.lang.Object)
will work rather than
throw an exception.
If isDone(), neither none of those will work. Once a Resolver is done, it is done forever.
isDone
in interface Resolver
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |