net.sf.jett.parser
Class FormulaParser

java.lang.Object
  extended by net.sf.jett.parser.FormulaParser

public class FormulaParser
extends java.lang.Object

A FormulaParser parses formulas in formula text, extracting out all cell references. A cell reference consists of an optional sheet name (optionally enclosed in single quotes) followed by an exclamation ("!"), followed by a legal cell reference (alpha-number format), optionally followed by a default value clause, which is two pipes followed by the default value: "||value".

Author:
Randy Gettman

Constructor Summary
FormulaParser()
          Create a FormulaParser.
FormulaParser(java.lang.String formulaText)
          Create a FormulaParser object that will parse the given formula text.
 
Method Summary
 java.util.List<CellRef> getCellReferences()
          Returns a List of CellRefs that this parser found in the formula text.
 void parse()
          Parses the formula text.
 void setFormulaText(java.lang.String formulaText)
          Sets the formula text to the given formula text and resets the parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormulaParser

public FormulaParser()
Create a FormulaParser.


FormulaParser

public FormulaParser(java.lang.String formulaText)
Create a FormulaParser object that will parse the given formula text.

Parameters:
formulaText - The text of the formula.
Method Detail

setFormulaText

public void setFormulaText(java.lang.String formulaText)
Sets the formula text to the given formula text and resets the parser.

Parameters:
formulaText - The new formula text.

parse

public void parse()
Parses the formula text.


getCellReferences

public java.util.List<CellRef> getCellReferences()
Returns a List of CellRefs that this parser found in the formula text.

Returns:
A List of CellRefs, possibly empty.


Copyright © 2012-2013 Jett Team. All Rights Reserved.