public class FormulaParser extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FORMULA_TYPE_ARRAY |
static int |
FORMULA_TYPE_CELL |
static int |
FORMULA_TYPE_CONDFOMRAT |
static int |
FORMULA_TYPE_NAMEDRANGE |
static int |
FORMULA_TYPE_SHARED |
Constructor and Description |
---|
FormulaParser(String formula,
Workbook book)
Create the formula parser, with the string that is to be
parsed against the supplied workbook.
|
Modifier and Type | Method and Description |
---|---|
Ptg[] |
getRPNPtg()
API call to retrive the array of Ptgs created as
a result of the parsing
|
Ptg[] |
getRPNPtg(int formulaType) |
void |
parse()
API call to execute the parsing of the formula
|
String |
toFormulaString(List lptgs)
Convience method which takes in a list then passes it to the
other toFormulaString signature.
|
String |
toFormulaString(Ptg[] ptgs)
Static method to convert an array of Ptgs in RPN order
to a human readable string format in infix mode.
|
static String |
toFormulaString(Workbook book,
List lptgs)
Convience method which takes in a list then passes it to the
other toFormulaString signature.
|
static String |
toFormulaString(Workbook book,
Ptg[] ptgs)
Static method to convert an array of Ptgs in RPN order
to a human readable string format in infix mode.
|
String |
toString()
toString on the parser instance returns the RPN ordered list of tokens
Useful for testing
|
public static int FORMULA_TYPE_CELL
public static int FORMULA_TYPE_SHARED
public static int FORMULA_TYPE_ARRAY
public static int FORMULA_TYPE_CONDFOMRAT
public static int FORMULA_TYPE_NAMEDRANGE
public FormulaParser(String formula, Workbook book)
public void parse()
public Ptg[] getRPNPtg()
public Ptg[] getRPNPtg(int formulaType)
public static String toFormulaString(Workbook book, List lptgs)
book
- workbook for 3D and named referenceslptgs
- list of Ptg, can be null or emptypublic String toFormulaString(List lptgs)
lptgs
- list of Ptg, can be null or emptypublic static String toFormulaString(Workbook book, Ptg[] ptgs)
book
- workbook for named and 3D referencesptgs
- array of Ptg, can be null or emptypublic String toFormulaString(Ptg[] ptgs)
ptgs
- array of Ptg, can be null or emptyCopyright © 2014 Open Microscopy Environment