org.erights.e.elib.ref
Class OneArgFuncAdapter

java.lang.Object
  |
  +--org.erights.e.elib.ref.OneArgFuncAdapter
All Implemented Interfaces:
OneArgFunc

public class OneArgFuncAdapter
extends Object
implements OneArgFunc

Untamed: Sends a message to target containing a cheap 1-argument function as argument. When this function is called it calls a method on the reactor with its argument. It's like the following E code:


     def OneArgFuncAdapter adapt(target, whenVerb, reactor, onVerb) {
         def adapter(arg) {
             E sendOnly(reactor, onVerb, [arg]);
         }
         E sendOnly(target, whenVerb, [adapter])
     }
 
Note that the on method (the method named by the onVerb) will be invoked after an additional send.

Author:
Mark S. Miller

Field Summary
private  String myOnVerb
           
private  Object myReactor
           
 
Constructor Summary
OneArgFuncAdapter(Object reactor, String onVerb)
          Enabled:
 
Method Summary
 void __printOn(TextWriter out)
          Enabled:
static Throwable adapt(Object target, String whenVerb, Object reactor, String onVerb)
          Enabled:
 Object run(Object arg)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myReactor

private final Object myReactor

myOnVerb

private final String myOnVerb
Constructor Detail

OneArgFuncAdapter

public OneArgFuncAdapter(Object reactor,
                         String onVerb)
Enabled:

Method Detail

adapt

public static Throwable adapt(Object target,
                              String whenVerb,
                              Object reactor,
                              String onVerb)
Enabled:


run

public Object run(Object arg)
Enabled:

Specified by:
run in interface OneArgFunc

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled:

IOException


comments?