Class RecursiveArgument

    • Field Detail

      • TYPE_ID_RECURSIVE

        public static final int TYPE_ID_RECURSIVE
        Type identifier for recursive arguments.
        See Also:
        Constant Field Values
      • TYPE_DESC_RECURSIVE

        public static final java.lang.String TYPE_DESC_RECURSIVE
        See Also:
        Constant Field Values
    • Constructor Detail

      • RecursiveArgument

        public RecursiveArgument​(java.lang.String argumentName,
                                 java.lang.String recursiveExpressionString,
                                 java.lang.String indexName)
        Constructor - creates recursive argument.
        Parameters:
        argumentName - the argument name
        recursiveExpressionString - the recursive expression string
        indexName - index argument name
      • RecursiveArgument

        public RecursiveArgument​(java.lang.String argumentName,
                                 java.lang.String recursiveExpressionString,
                                 Argument n,
                                 PrimitiveElement... elements)
        Constructor - creates recursive argument.
        Parameters:
        argumentName - the argument name
        recursiveExpressionString - the recursive expression string
        n - the index argument
        elements - Optional elements list (variadic - comma separated) of types: Argument, Constant, Function
        See Also:
        PrimitiveElement, Argument
      • RecursiveArgument

        public RecursiveArgument​(java.lang.String argumentDefinitionString,
                                 PrimitiveElement... elements)
        Constructor - creates argument based on the argument definition string.
        Parameters:
        argumentDefinitionString - Argument definition string, i.e.:
        • 'x' - only argument name
        • 'x=5' - argument name and argument value
        • 'x=2*5' - argument name and argument value given as simple expression
        • 'x=2*y' - argument name and argument expression (dependent argument 'x' on argument 'y')
        • 'x(n)=x(n-1)+x(n-2)' - for recursive arguments)
        elements - Optional elements list (variadic - comma separated) of types: Argument, Constant, Function
        See Also:
        PrimitiveElement, Argument
    • Method Detail

      • addBaseCase

        public void addBaseCase​(int index,
                                double value)
        Adds base case
        Parameters:
        index - the base case index
        value - the base case value
      • resetAllCases

        public void resetAllCases()
        Clears all based cases and stored calculated values
      • getArgumentValue

        public double getArgumentValue​(double index)
        Gets recursive argument value
        Parameters:
        index - the index
        Returns:
        value as double