diff options
author | Nick Burch <nick@apache.org> | 2007-10-15 13:48:51 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2007-10-15 13:48:51 +0000 |
commit | 6a4d5c5a7536699b652c098e77e667b95471f741 (patch) | |
tree | 056ead7ea38e9b7551bba539b8eba6a92f1b4e30 /src/java/org | |
parent | 1a2cdcd156a0f97acff5856a85a421b336768483 (diff) | |
download | poi-6a4d5c5a7536699b652c098e77e667b95471f741.tar.gz poi-6a4d5c5a7536699b652c098e77e667b95471f741.zip |
In FormulaParser, add in non-static methods too for toFormulaString, which use the existing Workbook. Also tweak licence notice for hdgf
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@584788 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/poi/hssf/model/FormulaParser.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/hssf/model/FormulaParser.java b/src/java/org/apache/poi/hssf/model/FormulaParser.java index 0132945565..9697dadafd 100644 --- a/src/java/org/apache/poi/hssf/model/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/model/FormulaParser.java @@ -889,8 +889,8 @@ end; } } /** - * Convience method which takes in a list then passes it to the other toFormulaString - * signature. + * Convience method which takes in a list then passes it to the + * other toFormulaString signature. * @param book workbook for 3D and named references * @param lptgs list of Ptg, can be null or empty * @return a human readable String @@ -903,6 +903,16 @@ end; retval = toFormulaString(book, ptgs); return retval; } + /** + * Convience method which takes in a list then passes it to the + * other toFormulaString signature. Works on the current + * workbook for 3D and named references + * @param lptgs list of Ptg, can be null or empty + * @return a human readable String + */ + public String toFormulaString(List lptgs) { + return toFormulaString(book, lptgs); + } /** * Static method to convert an array of Ptgs in RPN order @@ -968,6 +978,16 @@ end; // TODO: catch stack underflow and throw parse exception. return (String) stack.pop(); } + /** + * 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. + * @param ptgs array of Ptg, can be null or empty + * @return a human readable String + */ + public String toFormulaString(Ptg[] ptgs) { + return toFormulaString(book, ptgs); + } /** Create a tree representation of the RPN token array |