Uses of Class
com.accountingenhancements.formula.FormulaVariable

Packages that use FormulaVariable
com.accountingenhancements.formula BETA 9/10/2006
The formula package is a string based interpreted scripting math and string manipulation language written in Java.
It's intended to perform math and/or string concatination based on basic code segments that are stored in databases and work with dynamically created variables.
In an effort to improve speed in loops where some variables are stable and other variables change, levels of volatility can be assigned to variables. 
 

Uses of FormulaVariable in com.accountingenhancements.formula
 

Fields in com.accountingenhancements.formula declared as FormulaVariable
protected  FormulaVariable FormulaVariable.resolvedVariable
          If this is TYPE_VARIABLE then this is the value of the resultant value.
protected  FormulaVariable FormulaVariableStack.result
          This is the result when the stack resolved.
 

Fields in com.accountingenhancements.formula with type parameters of type FormulaVariable
protected  java.util.ArrayList<FormulaVariable> FormulaVariableList.variableArray
           
protected  java.util.HashMap<java.lang.String,FormulaVariable> FormulaVariableList.variableList
           
 

Methods in com.accountingenhancements.formula that return FormulaVariable
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.math.BigDecimal value)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.math.BigDecimal value, int scale)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.math.BigDecimal value, int scale, int level)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, boolean value)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, boolean value, int scale)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, boolean value, int scale, int level)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.util.Date value)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.util.Date value, int level)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, double value)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, double value, int scale)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, double value, int scale, int level)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, long value)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, long value, int level)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.lang.String value)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.lang.String value, boolean treatUnquotedTextAsFormulas)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.lang.String value, int level)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.lang.String value, int level, boolean treatUnquotedTextAsFormulas)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addValue(java.lang.String variableName, java.lang.String value, int scaleIfDouble, int level, boolean treatUnquotedTextAsFormulas)
          Add a value to the variable list.
 FormulaVariable FormulaVariableList.addVariable(FormulaVariable variable)
          Add a variable to the list.
 FormulaVariable FormulaVariableList.addVariable(java.lang.String variable)
          Add a variable where the variable name is part of the string.
 FormulaVariable FormulaVariableList.addVariable(java.lang.String variable, int level)
          Add a variable where the variable name is part of the string.
protected  FormulaVariable FormulaVariableList.addVariableToList(FormulaVariable variable)
          Adds the specified variable to the HashMap.
static FormulaVariable FormulaVariableMath.applyOperatorToTwoVariables(FormulaVariable leftVariable, int operator, FormulaVariable rightVariable, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Please note, when doing multiplication or division with doubles (where both variables are TYPE_DOUBLE, precision becomes important.
The lowest precision determines the number of digits to the right of the decimal point.
Ex: Assuming the precision of 10 is 2 (Not overriden by user so 2 digits long) .234 * 10 = 2.3 therefore scale=1
However, differing from real math, 12.345 * 10 = 123 (scale=0) instead of 120 (scale=-1) as regular math requires it because I am assuming user intent is that accuracy is always at least to the 1's place.
On a related note if one variable is a TYPE_LONG or TYPE_BOOLEAN , that variable defaults to a precision of 17, so in this case the precision ends up being the same as the precision of the only double value.
static FormulaVariable FormulaVariableMath.applyOperatorToTwoVariables(java.lang.Integer optionalLeftUnaryOperator, FormulaVariable leftVariable, int operator, java.lang.Integer optionalRightUnaryOperator, FormulaVariable rightVariable, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Please note, when doing multiplication or division with doubles (where both variables are TYPE_DOUBLE, precision becomes important.
The lowest precision determines the number of digits to the right of the decimal point.
Ex: Assuming the precision of 10 is 2 (Not overriden by user so 2 digits long) .234 * 10 = 2.3 therefore scale=1
However, differing from real math, 12.345 * 10 = 123 (scale=0) instead of 120 (scale=-1) as regular math requires it because I am assuming user intent is that accuracy is always at least to the 1's place.
On a related note if one variable is a TYPE_LONG or TYPE_BOOLEAN , that variable defaults to a precision of 17, so in this case the precision ends up being the same as the precision of the only double value.
This means (Assuming scale of 12.345 is 5) that 12.345 * 10 = 123.45 and scale=2.
 FormulaVariable FormulaVariable.clone()
           
 FormulaVariable FormulaFunction_IIF.function(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          IIF Function Based on the truth of a test, a FormulaVariable is returned by following the result of the true branch or the false branch.
 FormulaVariable FormulaFunction.function(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Programmer defined function.
 FormulaVariable FormulaFunction.function(FormulaVariableStack functionArgumentStack, FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Programmer defined function.
This function replaces the funcionArgumentStack and calls function(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel) so you can leave this function alone, but the other function needs to be overriden.
 FormulaVariable FormulaVariableStack.get(java.lang.String formulaVariableName)
           
 FormulaVariable Formula.get(java.lang.String variableName)
          Get a variable from the variable list.
 FormulaVariable FormulaVariableList.getVariable(java.lang.String variableName)
           
 FormulaVariable Formula.solve(FormulaVariable formulaVariable)
          Solve the specified variable.
 FormulaVariable Formula.solve(FormulaVariable formulaVariable, int resolveEverythingAboveLevel)
          Solve the specified variable.
 FormulaVariable FormulaVariableStack.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList)
          This solves the supplied formula and returns the result.
 FormulaVariable FormulaVariableStack.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
 FormulaVariable FormulaVariable.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          IF this variable is of TYPE_FORMULA, TYPE_FUNCTION, or TYPE_VARIABLE then this method solves for the value.
protected  FormulaVariable FormulaFunction_UCase.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction_Right.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction_Mid.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction_Len.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction_Left.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction_LCase.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction_DatePart.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction_DateAdd.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
protected  FormulaVariable FormulaFunction.solve(FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Actual method to be overridden.
 FormulaVariable Formula.solve(java.lang.String variableName)
          Solve the specified variable.
 FormulaVariable Formula.solve(java.lang.String variableName, int resolveEverythingAboveLevel)
          Solve the specified variable.
 FormulaVariable Formula.solveFormula(java.lang.String formula)
          You can use this to quickly solve a formula, however it won't keep the formula around so, to speed up execution, use the add(...) method to add the formula, as a variable, and assign a name.
 FormulaVariable Formula.solveFormula(java.lang.String formula, int resolveEverythingAboveLevel)
          You can use this to quickly solve a formula, however it won't keep the formula around so, to speed up execution, use the add(...) method to add the formula, as a variable, and assign a name.
static FormulaVariable Formula.solveQuickFormula(java.lang.String formula, java.lang.String variables)
          A static method for quick solutions.
static FormulaVariable FormulaVariableStack.solveRangeOfValuesSeparatedBySameOperator(java.util.ArrayList<FormulaVariable> stack, int startPointer, int endPointer, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
static FormulaVariable FormulaVariableMath.solveUnaryOfVariable(int unaryOperator, FormulaVariable variable, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Apply unary operations to variable
 

Methods in com.accountingenhancements.formula with parameters of type FormulaVariable
 FormulaVariable FormulaVariableList.addVariable(FormulaVariable variable)
          Add a variable to the list.
protected  FormulaVariable FormulaVariableList.addVariableToList(FormulaVariable variable)
          Adds the specified variable to the HashMap.
static FormulaVariable FormulaVariableMath.applyOperatorToTwoVariables(FormulaVariable leftVariable, int operator, FormulaVariable rightVariable, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Please note, when doing multiplication or division with doubles (where both variables are TYPE_DOUBLE, precision becomes important.
The lowest precision determines the number of digits to the right of the decimal point.
Ex: Assuming the precision of 10 is 2 (Not overriden by user so 2 digits long) .234 * 10 = 2.3 therefore scale=1
However, differing from real math, 12.345 * 10 = 123 (scale=0) instead of 120 (scale=-1) as regular math requires it because I am assuming user intent is that accuracy is always at least to the 1's place.
On a related note if one variable is a TYPE_LONG or TYPE_BOOLEAN , that variable defaults to a precision of 17, so in this case the precision ends up being the same as the precision of the only double value.
static FormulaVariable FormulaVariableMath.applyOperatorToTwoVariables(java.lang.Integer optionalLeftUnaryOperator, FormulaVariable leftVariable, int operator, java.lang.Integer optionalRightUnaryOperator, FormulaVariable rightVariable, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Please note, when doing multiplication or division with doubles (where both variables are TYPE_DOUBLE, precision becomes important.
The lowest precision determines the number of digits to the right of the decimal point.
Ex: Assuming the precision of 10 is 2 (Not overriden by user so 2 digits long) .234 * 10 = 2.3 therefore scale=1
However, differing from real math, 12.345 * 10 = 123 (scale=0) instead of 120 (scale=-1) as regular math requires it because I am assuming user intent is that accuracy is always at least to the 1's place.
On a related note if one variable is a TYPE_LONG or TYPE_BOOLEAN , that variable defaults to a precision of 17, so in this case the precision ends up being the same as the precision of the only double value.
This means (Assuming scale of 12.345 is 5) that 12.345 * 10 = 123.45 and scale=2.
 FormulaFunction FormulaFunctionList.getFunction(FormulaVariable functionVariable)
          This method will instantiate and return the correct function based on the TYPE_FUNCTION FormulaVariable handed to this routine.
protected static FormulaVariableStack FormulaFunction.getFunctionArgumentStackFromFunctionVariable(FormulaVariable functionVariable)
           
 void FormulaVariableList.removeVariable(FormulaVariable variable)
           
 FormulaVariable Formula.solve(FormulaVariable formulaVariable)
          Solve the specified variable.
 FormulaVariable Formula.solve(FormulaVariable formulaVariable, int resolveEverythingAboveLevel)
          Solve the specified variable.
static FormulaVariable FormulaVariableMath.solveUnaryOfVariable(int unaryOperator, FormulaVariable variable, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
          Apply unary operations to variable
 

Method parameters in com.accountingenhancements.formula with type arguments of type FormulaVariable
static FormulaVariable FormulaVariableStack.solveRangeOfValuesSeparatedBySameOperator(java.util.ArrayList<FormulaVariable> stack, int startPointer, int endPointer, FormulaVariableList variableList, SupportParameters supportParameters, FormulaFunctionList functionList, int resolveEverythingAboveLevel)
           
 

Constructors in com.accountingenhancements.formula with parameters of type FormulaVariable
FormulaFunction_DateAdd(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_DatePart(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_IIF(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_LCase(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_Left(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_Len(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_Mid(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_Right(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction_UCase(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.
FormulaFunction(FormulaVariable functionVariable)
          Create a new FormulaFunction from the functionVariable (A FormulaVariable of TYPE_FUNCTION).
This is the most common constructor used.