|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.actuate.util.Debug
|
+--com.f1j.util.Debug
|
+--com.f1j.util.ObjConst
|
+--com.f1j.util.Obj
|
+--com.f1j.util.AbstractIndexObj
|
+--com.f1j.util.IndexObj
|
+--com.f1j.calc.HitIndexObj
|
+--com.f1j.calc.Base
|
+--com.f1j.calc.Func
|
+--com.f1j.addin.Func
This is the base class for com.f1j.addin functions.
To add a function, simply instantiate an instance of a class derived from
the Func class.
| Constructor Summary | |
protected |
Func(java.lang.String name,
int iMinArgs,
int iMaxArgs)
Allocates a new Func object and adds the function
into the e.Spreadsheet calc engine. |
| Method Summary | |
protected abstract void |
evaluate(FuncContext funcContext)
Override this method to implement an e.Spreadsheet addin function. |
void |
setDeterminant()
Indicates that a function is determinant (always returns the same result given the same arguments). |
void |
setReferenceArgument(int iArgument)
Indicates that ranges or cells should be passed by reference. |
| Constructor Detail |
protected Func(java.lang.String name,
int iMinArgs,
int iMaxArgs)
Func object and adds the function
into the e.Spreadsheet calc engine.
By default, all com.f1j.addin functions are assumed to be
non-determinant. This means that formulas referring to these functions
are always recalculated, even if the arguments to the function do
not change. To change this default behavior, use the setDeterminant method.name - The name of the addin function.iMinArgs - The minimum number of arguments for this function.iMaxArgs - The maximum number of arguments for this function.setDeterminant()| Method Detail |
protected abstract void evaluate(FuncContext funcContext)
throws java.lang.Throwable
addin function.
Notes:
This method may be called by multiple threads, and must synchronize
access to member variables and other resources. Doing so will have a negative
impact on performance. Therefore, it is recommended that addin
functions do not access member variables or shared resources.
No changes should be made to any workbook from this method. Workbooks should be treated as read-only.
funcContext - provides information and arguments to the addin
function.addin
function if any exception is thrown.public void setDeterminant()
addin functions are assumed to be
non-determinant. This means that formulas referring to these
functions are always recalculated, even if the arguments to the function
do not change. Call this method to override the default behavior.
An example of a built in function which is non-determinant is RAND(). This
function returns a different result every time it is called. Two examples
of functions which are determinant are PI() and ABS(n). PI() always returns
the value of PI. ABS(n) always returns the same result for a given value
of n.public void setReferenceArgument(int iArgument)
Normally, a range or cell reference will be converted to the value of the cell
before the addin function is evaluated. Calling this method will
cause the specified argument to be passed as a range or cell reference.
iArgument - the zero-based index number of the argument to pass by
reference.Value.isCell(),
Value.isRange()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||