| Constructor and Description |
|---|
FormulaParser() |
| Modifier and Type | Method and Description |
|---|---|
static void |
adjustParameterIds(Stack expression)
adjustParameterIds pre-processes the function expression stack,
analyzing function parameters to ensure that function operands
contain the correct PtgID (which indicates Value, Reference or Array)
Reference-type ptg's contain an ID which indicates the type required by the calling function: Value, Reference or Array. |
static String |
getExpressionString(Stack expression) |
static Formula |
getFormulaFromString(String formStr,
Boundsheet st,
int[] rc)
create a new formula record at row column rc using formula string formStr
|
static String |
getFormulaString(Formula form) |
static int |
getMatchOperator(String input,
int startParenLoc,
char matchOpenChar,
char matchCloseChar) |
protected static Stack |
getPtgsFromFormulaString(String fmla) |
static Stack |
getPtgsFromFormulaString(XLSRecord form,
String fmla)
getPtgsFromFormulaString
returns ordered stack of Ptgs parsed from formula string fmla
|
protected static Stack |
getPtgsFromFormulaString(XLSRecord form,
String fmla,
boolean bMergeWithLast)
should handle all sorts of variations of formula strings such as:
=PV(C17,1+-(1*1)-9, 0, 1)
=100*0.5
=(B2-B3)*B4
=SUM(IF(A1:A10=B1:B10, 1, 0))
=IF(B4<=10,"10", if(b4<=100, "15", "20"))
="STRING"&IF(A<>"",A,"N/A")&" - &IF(C<>"",C,"N/A")&" Result "
in basic essence, handles signatures such as
a op f(b op c, d, uop e ...) op g
where op is any binary operator, uop is a unary operator f is a formula
...
|
static boolean |
isComplexRange(String s)
returns true if the string represents a complex range (i.e.
|
static boolean |
isRange(String s)
returns true if the stirng in question is in the form of a range
|
static boolean |
isRef(String s)
returns true of string s is in the form of a basic reference e.g.
|
static Formula |
setFormula(Formula form,
String fmla,
int[] rc)
parse a formula in string form and create a formula record from it
caluclate the new formula based on boolean setting calculate
|
static Formula |
setFormulaString(String formStr,
int[] rc)
create a new formula record at row column rc using formula string formStr
|
public static Stack getPtgsFromFormulaString(XLSRecord form, String fmla)
Formula - form formula recordString - fmla string rep. of current state of formula (either original "=F(Y)" or a recurrsed state e.g. "Y")protected static Stack getPtgsFromFormulaString(XLSRecord form, String fmla, boolean bMergeWithLast)
public static int getMatchOperator(String input, int startParenLoc, char matchOpenChar, char matchCloseChar)
public static Formula setFormula(Formula form, String fmla, int[] rc)
form - Formula recfmla - String formula either =EXPRESSION or {=EXPRESSION} for array formulascalculate - boolean truth of "calculate formula after setting"public static void adjustParameterIds(Stack expression)
public static Formula getFormulaFromString(String formStr, Boundsheet st, int[] rc) throws Exception
formStr - Stringst - rc - int[]Exceptionpublic static Formula setFormulaString(String formStr, int[] rc) throws Exception
formStr - Stringrc - int[]Exceptionpublic static boolean isRef(String s)
s - public static boolean isRange(String s)
s - public static boolean isComplexRange(String s)
s - Copyright © 2002–2019 Starter Inc.. All rights reserved.