ref_send API 2.17
defensive programming in Java

org.ref_send.promise
Class Do<P,R>

java.lang.Object
  extended by org.joe_e.Struct
      extended by org.ref_send.promise.Do<P,R>
Type Parameters:
P - parameter type
R - return type
All Implemented Interfaces:
Selfless

public abstract class Do<P,R>
extends Struct

An eventual conditional code block.


Method Summary
abstract  R fulfill(P arg)
          Notification of a fulfilled argument.
 R reject(java.lang.Exception reason)
          Notification of a rejected argument.
 
Methods inherited from class org.joe_e.Struct
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fulfill

public abstract R fulfill(P arg)
                   throws java.lang.Exception
Notification of a fulfilled argument.

Parameters:
arg - argument to the code block
Returns:
code block's return value
Throws:
java.lang.Exception - any exception produced by the code block

reject

public R reject(java.lang.Exception reason)
         throws java.lang.Exception
Notification of a rejected argument.

The default implementation throws reason.

Parameters:
reason - reason the code block's argument is not known
Returns:
code block's return value
Throws:
java.lang.Exception - any exception produced by the code block

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.