org.formulacompiler.compiler
Interface CallFrame

All Superinterfaces:
Describable

public interface CallFrame
extends Describable

Represents a call to a method including the argument values for all of the method's parameters. Can optionally represent a chain of calls. Implementations must be immutable.

This interface is an API only. Do not implement it yourself.

Author:
peo
See Also:
EngineBuilder.newCallFrame(Method, Object...), FormulaCompiler.newCallFrame(Method, Object...)

Nested Class Summary
static interface CallFrame.Factory
          Constructs instances of CallFrame.
 
Method Summary
 CallFrame chain(java.lang.reflect.Method _method, java.lang.Object... _args)
          Constructs a chained call.
 java.lang.Object[] getArgs()
          The list of argument values for the method's parameters.
 CallFrame[] getFrames()
          The call frames arranged in proper order to be called one by one, starting with an object of the head's class.
 CallFrame getHead()
          The first call in the chain of calls.
 java.lang.reflect.Method getMethod()
          The method to call.
 CallFrame getPrev()
          The previous call in the chain of calls.
 java.lang.Class getReturnType()
          The return type of the final call in the chain.
 
Methods inherited from interface org.formulacompiler.compiler.Describable
describe, toString
 

Method Detail

chain

CallFrame chain(java.lang.reflect.Method _method,
                java.lang.Object... _args)
Constructs a chained call.

Parameters:
_method - is the method to be called; must be callable on objects of the class returned by the current call.
_args - is the list of arguments for the method's parameters.
Returns:
A new frame that links back to this one.

getMethod

java.lang.reflect.Method getMethod()
The method to call.

Returns:
The method. Never null.

getArgs

java.lang.Object[] getArgs()
The list of argument values for the method's parameters.

Returns:
The list. Never null.

getReturnType

java.lang.Class getReturnType()
The return type of the final call in the chain.

Returns:
The type.

getPrev

CallFrame getPrev()
The previous call in the chain of calls.

Returns:
The previous call, or null.

getHead

CallFrame getHead()
The first call in the chain of calls.

Returns:
The first call. Never null.

getFrames

CallFrame[] getFrames()
The call frames arranged in proper order to be called one by one, starting with an object of the head's class.

Returns:
A new array of frames. Never null.