com.apama.functional
Event Partial


Holds an action whose arguments are partially specified, leaving the remaining argument(s) to be supplied later.

Binding the first one or more arguments results in a Partial holding an action with fewer (or no) arguments than the original action. This partial action can later be executed with just the remaining arguments.

Example:
Partial partial := Fn.partial(Fn.concat, "Hello ");
log Fn.map(["Bob", "Alice"], partial).toString(); // logs a sequence of ["Hello Bob", "Hello Alice"]


If the bound arguments aren't the first arguments to the underlying function, then you can provide placeholders. These refer to the arguments of the resulting partial action and where they should be inserted into the bound arguments.

Example:
Fn.map(["Hi Bob", "Hi Alice"], Fn.partial(replaceString, [Fn.$(1), "Hi", "Hello"]))


Here, instead of the argument from map being passed as the final argument to replaceString it is inserted as the first argument, before the two literals provided to partial.
Since:
10.15.3.0
See Also:
com.apama.functional.Fn.partial() - Use this to create a Partial by binding the initial argument value(s).
com.apama.functional.Fn.$() - Use this to specify placeholders in the argument list.

Action summary
 action<sequence<any>> returns anystatic resolve(any callable)

Returns a generic action that can be used to execute an action or Partial function.
 anyexec(any args)

Executes the underlying function, passing in the remaining arguments.
 com.apama.functional.Partialpartial(any arguments)

Adds more arguments and returns a new Partial which wraps this one.
 
Action detail

resolve

action<sequence<any>> returns any static resolve(any callable)
Returns a generic action that can be used to execute an action or Partial function.
Parameters:
callable - Either an action or a Partial instance.
Returns:
A generic action of a uniform type which either executes the action, or the Partial function.
Since:
10.15.3.0

exec

any exec(any args)
Executes the underlying function, passing in the remaining arguments.
Parameters:
args - The remaining single argument, or sequence of all remaining arguments.
Returns:
The result of executing the underlying function with the original and remaining arguments.
Since:
10.15.3.0

partial

com.apama.functional.Partial partial(any arguments)
Adds more arguments and returns a new Partial which wraps this one.
Parameters:
arguments - The additional single argument, or sequence of additional arguments.
Returns:
A new Partial which, when invoked, calls this one with the supplied arguments.
Since:
10.15.3.0