Save This Page
Home » poi-src-3.2-FINAL-20081019 » org.apache » poi » hssf » model » [javadoc | source]
org.apache.poi.hssf.model
public final class: FormulaParser [javadoc | source]
java.lang.Object
   org.apache.poi.hssf.model.FormulaParser
This class parses a formula string into a List of tokens in RPN order. Inspired by Lets Build a Compiler, by Jack Crenshaw BNF for the formula expression is : ::= [ ]* ::= [ ]* ::= | () | | ::= ([expression [, expression]*])
    author: Avik - Sengupta
    author: Andrew - C. oliver (acoliver at apache dot org)
    author: Eric - Ladner (eladner at goldinc dot com)
    author: Cameron - Riley (criley at ekmail.com)
    author: Peter - M. Murray (pete at quantrix dot com)
    author: Pavel - Krupets (pkrupets at palmtreebusiness dot com)
Nested Class Summary:
static final class  FormulaParser.FormulaParseException  Specific exception thrown when a supplied formula does not parse properly.
Primarily used by test cases when testing for specific parsing exceptions.

 
Field Summary
public static final  int FORMULA_TYPE_CELL     
public static final  int FORMULA_TYPE_SHARED     
public static final  int FORMULA_TYPE_ARRAY     
public static final  int FORMULA_TYPE_CONDFOMRAT     
public static final  int FORMULA_TYPE_NAMEDRANGE     
Constructor:
 public FormulaParser(String formula,
    HSSFWorkbook book) 
    Create the formula parser, with the string that is to be parsed against the supplied workbook. A later call the parse() method to return ptg list in rpn order, then call the getRPNPtg() to retrive the parse results. This class is recommended only for single threaded use. If you only have a usermodel.HSSFWorkbook, and not a model.Workbook, then use the convenience method on usermodel.HSSFFormulaEvaluator
Method from org.apache.poi.hssf.model.FormulaParser Summary:
getRPNPtg,   getRPNPtg,   parse,   parse,   toFormulaString,   toFormulaString,   toFormulaString,   toFormulaString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.poi.hssf.model.FormulaParser Detail:
 public Ptg[] getRPNPtg() 
    API call to retrive the array of Ptgs created as a result of the parsing
 public Ptg[] getRPNPtg(int formulaType) 
 public  void parse() 
Deprecated! use - Ptg[] FormulaParser.parse(String, HSSFWorkbook) directly

    API call to execute the parsing of the formula
 public static Ptg[] parse(String formula,
    HSSFWorkbook book) 
 public String toFormulaString(List lptgs) 
    Convenience method which takes in a list then passes it to the other toFormulaString signature. Works on the current workbook for 3D and named references
 public String toFormulaString(Ptg[] ptgs) 
    Static method to convert an array of Ptgs in RPN order to a human readable string format in infix mode. Works on the current workbook for named and 3D references.
 public static String toFormulaString(HSSFWorkbook book,
    List lptgs) 
    Convenience method which takes in a list then passes it to the other toFormulaString signature.
 public static String toFormulaString(HSSFWorkbook book,
    Ptg[] ptgs) 
    Static method to convert an array of Ptgs in RPN order to a human readable string format in infix mode.