net.spy.util
Class Promise

java.lang.Object
  extended bynet.spy.util.Promise

public abstract class Promise
extends Object

A promise, continuation style code for java.


Constructor Summary
Promise()
          Get an instance of Promise.
 
Method Summary
protected abstract  Object execute()
          Do the actual work required to get the Object we're promised.
 Object getObject()
          Get the object.
 String toString()
          Print me.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Promise

public Promise()
Get an instance of Promise.

Method Detail

getObject

public final Object getObject()
                       throws BrokenPromiseException
Get the object.

Returns:
the Object we were promised.
Throws:
BrokenPromiseException - if there's a problem getting what we were promised.

toString

public String toString()
Print me.


execute

protected abstract Object execute()
                           throws BrokenPromiseException
Do the actual work required to get the Object we're promised.

Throws:
BrokenPromiseException