ValueType
- The type of the value to wrappublic class ParallelFuture<ValueType> extends Object implements HjFuture<ValueType>
Modifier and Type | Class and Description |
---|---|
static class |
ParallelFuture.EventType |
static class |
ParallelFuture.ExecutionState |
HjFuture.CancelledException
Modifier and Type | Field and Description |
---|---|
protected HabaneroActivity |
activity |
Modifier | Constructor and Description |
---|---|
protected |
ParallelFuture()
No-args Constructor.
|
protected |
ParallelFuture(boolean allowDuplicatePuts) |
Modifier and Type | Method and Description |
---|---|
protected void |
attachListener(PropertyChangeListener changeListener)
attachListener.
|
boolean |
cancel()
Attempts to cancel execution of this task.
|
static <ValueType> |
factory()
Factory method.
|
boolean |
failed()
Return true if there was an exception while computing the value.
|
void |
failed(Exception ex)
Notifies that there was an exception while computing the result of the futureNb.
|
ValueType |
get()
Returns the value wrapped in the futureNb.
|
long |
id() |
protected boolean |
isCancelled() |
protected boolean |
markStart() |
protected Runnable |
preReleaseCallback() |
void |
put(ValueType newValue)
Associates the specified value with the HjFuture.
|
boolean |
resolved()
Returns whether the futureNb has been resolved, i.e. the value has been computed.
|
protected ValueType |
retrieveValue() |
ValueType |
safeGet()
Returns the value wrapped in the Future.
|
protected void |
throwPutFailedException(ValueType newValue)
throwPutFailedException.
|
protected HabaneroActivity activity
protected ParallelFuture()
protected ParallelFuture(boolean allowDuplicatePuts)
public long id()
public static <ValueType> ParallelFuture<ValueType> factory()
ValueType
- The type of the value to wrapprotected final void attachListener(PropertyChangeListener changeListener)
attachListener.
changeListener
- The listener to attach to the futureNb. The listener may be synchronously triggered.protected boolean isCancelled()
protected boolean markStart()
public final void put(ValueType newValue)
newValue
- The value to store into the futureNb.protected void throwPutFailedException(ValueType newValue)
throwPutFailedException.
newValue
- The value attempted to put into the futureNbpublic final void failed(Exception ex)
Exception
as the reason of failure while computing the result of the HjFuture. This operation may fail
if the single assignment property is violated.ex
- The exception while computing the result of the futureNbpublic ValueType get() throws SuspendableException
If the futureNb task has not completed as yet, the task performing the get() operation blocks until the result of the futureNb becomes available.
get
in interface HjFuture<ValueType>
SuspendableException
public ValueType safeGet()
It is illegal to perform a safeGet() operation on an empty Future (i.e. one that has not yet been resolved).
public final boolean resolved()
public boolean failed()
public boolean cancel()
protected Runnable preReleaseCallback()
protected ValueType retrieveValue()
Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.