[]
CalcEngine.Functions.Function
Function
• new Function(name?
, minArgs?
, maxArgs?
, description?
)
Represents an abstract base class for defining functions.
Name | Type | Description |
---|---|---|
name? |
string |
The name of the function. |
minArgs? |
number |
The minimum number of arguments for the function. |
maxArgs? |
number |
The maximum number of arguments for the function. |
description? |
IFunctionDescription |
- |
• maxArgs: number
Represents the maximum number of arguments for the function.
• minArgs: number
Represents the minimum number of arguments for the function.
• name: string
Represents the name of the function.
• typeName: string
Represents the type name string used for supporting serialization.
▸ acceptsArray(argIndex
): boolean
Determines whether the function accepts array values for the specified argument.
function
Name | Type | Description |
---|---|---|
argIndex |
number |
Index of the argument. |
boolean
▸ acceptsError(argIndex
): boolean
Indicates whether the function can process Error values.
function
Name | Type | Description |
---|---|---|
argIndex |
number |
Index of the argument. |
boolean
▸ acceptsMissingArgument(argIndex
): boolean
Indicates whether the Evaluate method can process missing arguments.
Name | Type | Description |
---|---|---|
argIndex |
number |
Index of the argument |
boolean
▸ acceptsReference(argIndex
): boolean
Determines whether the function accepts Reference values for the specified argument.
function
Name | Type | Description |
---|---|---|
argIndex |
number |
Index of the argument. |
boolean
▸ description(): IFunctionDescription
Returns the description of the function.
function
The description of the function.
▸ evaluate(...args
): any
Returns the result of the function applied to the arguments.
Name | Type | Description |
---|---|---|
...args |
any |
Arguments for the function evaluation |
any
The result of the function applied to the arguments.
▸ findBranchArgument(test
): number
Finds the branch argument.
Name | Type | Description |
---|---|---|
test |
any |
The test. |
number
Indicates the index of the argument that would be treated as the branch condition.
▸ findTestArgument(): number
Finds the test argument when this function is branched.
number
Indicates the index of the argument that would be treated as the test condition.
▸ isBranch(): boolean
Gets a value that indicates whether this function is branched by arguments as conditional.
boolean
▸ isContextSensitive(): boolean
Determines whether the evaluation of the function is dependent on the context in which the evaluation occurs.
boolean
▸ isVolatile(): boolean
Determines whether the function is volatile while it is being evaluated.
boolean