|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface SpreadsheetBinder.Section
Represents both the container for the definitions of global spreadsheet cells and instances of horizontal or vertical sections within a spreadsheet. See the tutorial for details on sections.
This interface is an API only. Do not implement it yourself.
SpreadsheetBinder.getRoot()
,
EngineBuilder.getRootBinder()
Method Summary | |
---|---|
void |
defineInputCell(Spreadsheet.Cell _cell,
CallFrame _callChainToCall)
Marks a given spreadsheet cell as a variable input to the constructed engine and binds it to the given method call chain. |
void |
defineInputCell(Spreadsheet.Cell _cell,
java.lang.reflect.Method _methodToCall,
java.lang.Object... _args)
Like defineInputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame) ,
but constructs the CallFrame directly. |
void |
defineInputCell(Spreadsheet.Cell _cell,
java.lang.String _nameOfMethodToCall)
Like defineInputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame) ,
but constructs the CallFrame directly from a method looked up by name on
getInputClass() . |
void |
defineOutputCell(Spreadsheet.Cell _cell,
CallFrame _callToImplement)
Marks a given spreadsheet cell as a computable output of the constructed engine and binds it to the given call. |
void |
defineOutputCell(Spreadsheet.Cell _cell,
java.lang.reflect.Method _methodToImplement,
java.lang.Object... _args)
Like defineOutputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame) ,
but constructs the CallFrame directly. |
void |
defineOutputCell(Spreadsheet.Cell _cell,
java.lang.String _nameOfMethodToImplement)
Like defineOutputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame) ,
but constructs the CallFrame directly from a method looked up by name on
getOutputClass() . |
SpreadsheetBinder.Section |
defineRepeatingSection(Spreadsheet.Range _range,
Orientation _orientation,
CallFrame _inputCallChainReturningIterable,
java.lang.Class _inputClass,
CallFrame _outputCallReturningIterableToImplement,
java.lang.Class _outputClass)
Defines a range in the spreadsheet as a section of similar, repeating rows (or columns). |
SpreadsheetBinder.Section |
defineRepeatingSection(Spreadsheet.Range _range,
Orientation _orientation,
java.lang.reflect.Method _inputMethodReturningIterable,
java.lang.Class _inputClass,
java.lang.reflect.Method _outputMethodReturningIterableToImplement,
java.lang.Class _outputClass)
Like defineRepeatingSection(org.formulacompiler.spreadsheet.Spreadsheet.Range, Orientation, CallFrame, Class, CallFrame, Class) ,
but constructs the CallFrame instances directly. |
SpreadsheetBinder.Section |
defineRepeatingSection(Spreadsheet.Range _range,
Orientation _orientation,
java.lang.String _nameOfInputMethodReturningIterable,
java.lang.Class _inputClass,
java.lang.String _nameOfOutputMethodReturningIterableToImplement,
java.lang.Class _outputClass)
Like defineRepeatingSection(org.formulacompiler.spreadsheet.Spreadsheet.Range, Orientation, CallFrame, Class, CallFrame, Class) ,
but constructs the CallFrame instances directly. |
java.lang.Class |
getInputClass()
The class of the input type to whose methods you are binding input elements. |
java.lang.Class |
getOutputClass()
The class of the output type whose methods you are binding to output elements. |
Method Detail |
---|
java.lang.Class getInputClass()
java.lang.Class getOutputClass()
void defineInputCell(Spreadsheet.Cell _cell, CallFrame _callChainToCall) throws CompilerException
_cell
- is a spreadsheet cell whose value, rather than being assumed constant, will be
defined later, when a specific engine computation is run. The cell is thus like a
parameter to a Java method._callChainToCall
- will be called during computations to obtain the value of the input
cell. The type of the cell is inferred from the return type of the last method in
the chain. The head of the chain must be callable on the input class of this name
space.
CompilerException
defineOutputCell(Spreadsheet.Cell, CallFrame)
,
Spreadsheet.getCell(int, int, int)
,
Spreadsheet.getCell(String)
void defineInputCell(Spreadsheet.Cell _cell, java.lang.reflect.Method _methodToCall, java.lang.Object... _args) throws CompilerException
defineInputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
but constructs the CallFrame
directly.
CompilerException
defineInputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
FormulaCompiler.newCallFrame(Method, Object...)
void defineInputCell(Spreadsheet.Cell _cell, java.lang.String _nameOfMethodToCall) throws CompilerException, java.lang.NoSuchMethodException
defineInputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
but constructs the CallFrame
directly from a method looked up by name on
getInputClass()
.
CompilerException
java.lang.NoSuchMethodException
defineInputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
getInputClass()
,
FormulaCompiler.newCallFrame(Method, Object...)
void defineOutputCell(Spreadsheet.Cell _cell, CallFrame _callToImplement) throws CompilerException
_cell
- is a spreadsheet cell whose valuewill be computed later, when a specific
engine computation is run. The cell is thus like a return value of a Java method._callToImplement
- is what you call on a computation to obtain the actual value of the
output cell in a specific computation. The type of the cell is inferred from the
return type of the call. The call may not be a chain. The call must be applicable
to the output class of this section. If the call is parametrized, the compiler
generates internal lookup code that maps the given argument values to the given
output cell. Other argument values can be bound to other cells. Unbound values
will call the inherited implementation (which must not be abstract).
CompilerException
defineInputCell(Spreadsheet.Cell, CallFrame)
,
Spreadsheet.getCell(int, int, int)
,
Spreadsheet.getCell(String)
void defineOutputCell(Spreadsheet.Cell _cell, java.lang.reflect.Method _methodToImplement, java.lang.Object... _args) throws CompilerException
defineOutputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
but constructs the CallFrame
directly.
CompilerException
defineOutputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
FormulaCompiler.newCallFrame(Method, Object...)
void defineOutputCell(Spreadsheet.Cell _cell, java.lang.String _nameOfMethodToImplement) throws CompilerException, java.lang.NoSuchMethodException
defineOutputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
but constructs the CallFrame
directly from a method looked up by name on
getOutputClass()
.
CompilerException
java.lang.NoSuchMethodException
defineOutputCell(org.formulacompiler.spreadsheet.Spreadsheet.Cell, CallFrame)
,
getOutputClass()
,
FormulaCompiler.newCallFrame(Method, Object...)
SpreadsheetBinder.Section defineRepeatingSection(Spreadsheet.Range _range, Orientation _orientation, CallFrame _inputCallChainReturningIterable, java.lang.Class _inputClass, CallFrame _outputCallReturningIterableToImplement, java.lang.Class _outputClass) throws CompilerException
The compiler uses the first row (or column) of the range as a template for all other rows (or columns). It does not currently check that all rows (or columns) are in fact similar in structure in the model spreadsheet. The compiler does not support auto-extending constant series, for example the series 1, 2, 3 ... n.
_range
- is the range whose rows (or columns) should be repeated._orientation
- indicates the orientation of the variable extent. Horizontal means
repeating columns, vertical means repeating rows._inputCallChainReturningIterable
- gets called on a computation's input to return an
iterable for the elements that the repeating section should effectively have._inputClass
- is the input type of the returned section._outputCallReturningIterableToImplement
- is implemented on the output class to
iterate the elements of the repeating section and compute output values for them.
Can be null
._outputClass
- is the output type of the returned section.
CompilerException
Spreadsheet.getRange(String)
SpreadsheetBinder.Section defineRepeatingSection(Spreadsheet.Range _range, Orientation _orientation, java.lang.reflect.Method _inputMethodReturningIterable, java.lang.Class _inputClass, java.lang.reflect.Method _outputMethodReturningIterableToImplement, java.lang.Class _outputClass) throws CompilerException
defineRepeatingSection(org.formulacompiler.spreadsheet.Spreadsheet.Range, Orientation, CallFrame, Class, CallFrame, Class)
,
but constructs the CallFrame
instances directly.
CompilerException
SpreadsheetBinder.Section defineRepeatingSection(Spreadsheet.Range _range, Orientation _orientation, java.lang.String _nameOfInputMethodReturningIterable, java.lang.Class _inputClass, java.lang.String _nameOfOutputMethodReturningIterableToImplement, java.lang.Class _outputClass) throws CompilerException, java.lang.NoSuchMethodException
defineRepeatingSection(org.formulacompiler.spreadsheet.Spreadsheet.Range, Orientation, CallFrame, Class, CallFrame, Class)
,
but constructs the CallFrame
instances directly.
CompilerException
java.lang.NoSuchMethodException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |