Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

Protected constructor

  • new LogicalOperationFunction(name: string, priority: number, operator: string, description?: undefined | string, storesValues?: undefined | false | true): LogicalOperationFunction
  • new LogicalOperationFunction(name: string, description?: undefined | string, storesValues?: undefined | false | true, isAsyncron?: undefined | false | true): LogicalOperationFunction
  • Creates a new operator-function

    Parameters

    • name: string

      Name of the function used in script. Use capital letters\ (e.g. MY_FUNCTION)

    • priority: number

      Priority of this operation according javascript-standard. Higher value => higher priority. Operation with higher priority are called first. (https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)

    • operator: string

      Character(s) used for this operator function\ (e.g. >=, ==, !=).

    • Optional description: undefined | string

      Description about the function

    • Optional storesValues: undefined | false | true

      If true, function contains data to be hold until next call. Default is false.

    Returns LogicalOperationFunction

  • Creates a new function

    Parameters

    • name: string

      Name of the function used in script. Use capital letters\ (e.g. MY_FUNCTION)

    • Optional description: undefined | string

      Description about the function

    • Optional storesValues: undefined | false | true

      If true, function contains data to be hold until next call. Default is false.

    • Optional isAsyncron: undefined | false | true

      If true, function must be executed asyncron. Default is false. Therefore override method BaseFunction.executeAsync. If false, override BaseFunction.execute

    Returns LogicalOperationFunction

Methods

Abstract clone

execute

  • Parameters

    Returns any

executeAsync

  • executeAsync(preexecutedArguments: any[], environment: ScriptEnvironment, node: Node, execPath?: undefined | string): Promise<any>
  • Parameters

    • preexecutedArguments: any[]
    • environment: ScriptEnvironment
    • node: Node
    • Optional execPath: undefined | string

    Returns Promise<any>

Protected Abstract executeLogicalOperation

  • executeLogicalOperation(values: boolean[]): boolean
  • Parameters

    • values: boolean[]

    Returns boolean

Protected getArgumentError

  • Returns the first argument with error inside args, if args is an array. Or args itself, if args is an object of ExpressionError (or derived).

    Parameters

    • args: any | any[]

    Returns ExpressionError | undefined

Protected getArgumentValue

  • getArgumentValue(argument: any, index: number, node: Node): boolean
  • Returns the provided argument as boolean. Throws an error if conversion failed!

    Parameters

    • argument: any
    • index: number
    • node: Node

    Returns boolean

getDescription

  • getDescription(): string
  • Returns the description of this function. An empty string if a description is not available.

    Returns string

getName

  • getName(): string
  • Returns the name of the function

    Returns string

getOperator

  • getOperator(): string
  • Returns the operator-character of this function. Throws an error if this function is not useable as operation.

    Returns string

getPriority

  • getPriority(): number
  • Returns the priority of this function. Only needed for operators.

    Returns number

Protected hasArgumentError

  • hasArgumentError(args: any | any[]): boolean
  • Returns true if args is an ExpressionError-object or an array which contains an ExpressionError-object.

    Parameters

    • args: any | any[]

    Returns boolean

hasHigherPriorityThan

  • hasHigherPriorityThan(priority: number): boolean

isAsyncron

  • isAsyncron(): boolean
  • Returns true if this function must be called asyncron and returns the value not immediately.

    Returns boolean

isOperator

  • isOperator(): boolean
  • Returns true if this function is also available as operation (using operator)

    Returns boolean

isPreexecutedArgument

  • isPreexecutedArgument(index: number, node: Node): boolean
  • Returns true, if the argument (node-children) should be executed before execute of this function is called. By default, returns true for all arguments. Override in function if certain arguments are executed for getting ther value inside the execute-method.

    Parameters

    • index: number

      Zero-based index of the argument

    • node: Node

      The node, none executed (result is not availabe at that time)

    Returns boolean

isStoring

  • isStoring(): boolean
  • Returns true if this function is storing values between the calls. So, an instance needs to be created for each occurrence.

    Returns boolean

toString

  • toString(): string

Generated using TypeDoc