orc.lib.util
Class Apply

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.sites.Site
          extended by orc.lib.util.Apply
All Implemented Interfaces:
Callable

public class Apply
extends Site

Apply a callable to a list of arguments. HACK: this is a subclass of site but has slightly different semantics: the callable argument is forced as a call (i.e. free variables in the callable are not forced).

Author:
quark

Field Summary
 
Fields inherited from class orc.runtime.values.Value
futureNotReady
 
Constructor Summary
Apply()
           
 
Method Summary
 void callSite(Args args, Token caller)
          Must be implemented by subclasses to implement the site behavior
 void createCall(Token caller, java.util.List<java.lang.Object> args, TokenContinuation nextNode)
          Invoked by a Call to invoke a site.
 Type type()
           
 
Methods inherited from class orc.runtime.sites.Site
accept
 
Methods inherited from class orc.runtime.values.Value
forceArg, forceCall, signal, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Apply

public Apply()
Method Detail

createCall

public void createCall(Token caller,
                       java.util.List<java.lang.Object> args,
                       TokenContinuation nextNode)
                throws TokenException
Description copied from class: Site
Invoked by a Call to invoke a site. The argument list is scanned to make sure that all parameters are bound. If an unbound parameter is found, the call is placed on a queue and nothing more is done. Once all parameters are bound, their values are collected and the corresponding subclass (the actual site) is called.

Specified by:
createCall in interface Callable
Overrides:
createCall in class Site
Parameters:
caller - token for which the call is being made: points to the call node
args - argument list
nextNode - next node after the call node, to which the result should be sent
Throws:
TokenException
See Also:
Callable.createCall(Token, List, TokenContinuation)

callSite

public void callSite(Args args,
                     Token caller)
              throws TokenException
Description copied from class: Site
Must be implemented by subclasses to implement the site behavior

Specified by:
callSite in class Site
Parameters:
args - list of argument values
caller - where the result should be sent
Throws:
TokenException

type

public Type type()
Overrides:
type in class Site