tho I'm personally happy to see POI just as a file format reader... well, as you'd have noticed, its often requested. So yeah, I'd be interested in seeing this.
My concerns would be first that this have adequate documentation and unit tests.
I think that is paramount in functionality of this nature (and shouldnt be
difficult to test, either)
Also, I wonder what kind of API would be appropriate for this functionality.
One, since it is impossible to implement ALL excel functions immediately, the
code should degrade gracefully, while at the same time provide enuf feedback to
the called. Also, I would therefore like that adding new implementations of
functions should be easy.
I would also prefer if the math implementation could be pluggable.. if someone were to want to integrate with pre-built math libraries in the future.
But in any case, lets see what you have. I am happy to have this added so long as there are sufficient tests and docs.
Quoting Amol Deshmukh <[EMAIL PROTECTED]>:
I wanted to know if any work has been done for providing formula evaluation functionality in POI. (I realise that POI is basically a file-format translator, but such a utility could be useful when reading from files.)
If there has been no work done so far wrt formula evaluation and it is deemed a useful feature, I would like to contribute my solution for this. I have a partially implemented solution (based on FormulaParser and *Ptg classes) that works for most common formulas with limited function support (although thats only because I havent had the time to implement all std excel functions, not a limitation of the approach per se). What is the best way to submit this code for evaluation (no pun intended :)?
Regards, ~ amol
Notes: Brief description of approach: 1. added function: "abstract Ptg evaluate(Ptg[] operands)" to OperationPtg and implemented it in every concrete operation class. 2. Used FormulaParser to get RPN tokens from FormulaString and using simple stack operations called evaluate on an operation token. 3. Functions are implemented as individual classes each having a "Ptg evaluate(Ptg[] operands)" method. 4. All above operations are driven by FormulaEvaluator which also performs evaluation of AreaPtg and ReferencePtg before invoking operations or functions.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
