From 07fe38b4ce6af514d3624cd71c2f4a7906fe7f6b Mon Sep 17 00:00:00 2001 From: Avik Sengupta Date: Thu, 19 May 2005 12:15:52 +0000 Subject: [PATCH] Initial checkin for FormulaEvaluator and associated tests Author: Amol Deshmukh git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353688 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/record/formula/eval/AddEval.java | 81 ++ .../hssf/record/formula/eval/Area2DEval.java | 75 ++ .../hssf/record/formula/eval/Area3DEval.java | 77 ++ .../hssf/record/formula/eval/AreaEval.java | 100 +++ .../hssf/record/formula/eval/BlankEval.java | 17 + .../hssf/record/formula/eval/BoolEval.java | 41 + .../hssf/record/formula/eval/ConcatEval.java | 61 ++ .../hssf/record/formula/eval/DivideEval.java | 86 +++ .../hssf/record/formula/eval/EqualEval.java | 51 ++ .../hssf/record/formula/eval/ErrorEval.java | 609 +++++++++++++++ .../poi/hssf/record/formula/eval/Eval.java | 13 + .../hssf/record/formula/eval/FuncVarEval.java | 44 ++ .../record/formula/eval/FunctionEval.java | 379 ++++++++++ .../record/formula/eval/GreaterEqualEval.java | 51 ++ .../record/formula/eval/GreaterThanEval.java | 51 ++ .../record/formula/eval/LessEqualEval.java | 51 ++ .../record/formula/eval/LessThanEval.java | 52 ++ .../record/formula/eval/MultiplyEval.java | 84 +++ .../record/formula/eval/NotEqualEval.java | 52 ++ .../hssf/record/formula/eval/NumberEval.java | 55 ++ .../formula/eval/NumericOperationEval.java | 50 ++ .../record/formula/eval/NumericValueEval.java | 14 + .../record/formula/eval/OperationEval.java | 37 + .../hssf/record/formula/eval/PowerEval.java | 86 +++ .../hssf/record/formula/eval/Ref2DEval.java | 44 ++ .../hssf/record/formula/eval/Ref3DEval.java | 44 ++ .../poi/hssf/record/formula/eval/RefEval.java | 57 ++ .../formula/eval/RelationalOperationEval.java | 200 +++++ .../hssf/record/formula/eval/StringEval.java | 29 + .../formula/eval/StringOperationEval.java | 81 ++ .../record/formula/eval/StringValueEval.java | 14 + .../record/formula/eval/SubtractEval.java | 84 +++ .../record/formula/eval/UnaryMinusEval.java | 71 ++ .../record/formula/eval/UnaryPlusEval.java | 131 ++++ .../hssf/record/formula/eval/ValueEval.java | 13 + .../eval/ValueEvalToNumericXlator.java | 203 +++++ .../hssf/record/formula/functions/Abs.java | 62 ++ .../hssf/record/formula/functions/Absref.java | 13 + .../hssf/record/formula/functions/Acos.java | 62 ++ .../hssf/record/formula/functions/Acosh.java | 60 ++ .../record/formula/functions/Activecell.java | 13 + .../hssf/record/formula/functions/Addbar.java | 13 + .../record/formula/functions/Addcommand.java | 13 + .../record/formula/functions/Addmenu.java | 13 + .../record/formula/functions/Address.java | 13 + .../record/formula/functions/Addtoolbar.java | 13 + .../hssf/record/formula/functions/And.java | 73 ++ .../record/formula/functions/Apptitle.java | 13 + .../hssf/record/formula/functions/Areas.java | 13 + .../record/formula/functions/Argument.java | 13 + .../hssf/record/formula/functions/Asc.java | 13 + .../hssf/record/formula/functions/Asin.java | 62 ++ .../hssf/record/formula/functions/Asinh.java | 67 ++ .../hssf/record/formula/functions/Atan.java | 62 ++ .../hssf/record/formula/functions/Atan2.java | 77 ++ .../hssf/record/formula/functions/Atanh.java | 67 ++ .../hssf/record/formula/functions/Avedev.java | 13 + .../record/formula/functions/Average.java | 13 + .../record/formula/functions/Averagea.java | 13 + .../record/formula/functions/Betadist.java | 13 + .../record/formula/functions/Betainv.java | 13 + .../record/formula/functions/Binomdist.java | 13 + .../formula/functions/BooleanFunction.java | 84 +++ .../hssf/record/formula/functions/Call.java | 13 + .../hssf/record/formula/functions/Caller.java | 13 + .../record/formula/functions/Cancelkey.java | 13 + .../record/formula/functions/Ceiling.java | 14 + .../hssf/record/formula/functions/Cell.java | 13 + .../hssf/record/formula/functions/Char.java | 13 + .../formula/functions/Checkcommand.java | 13 + .../record/formula/functions/Chidist.java | 13 + .../hssf/record/formula/functions/Chiinv.java | 13 + .../record/formula/functions/Chitest.java | 13 + .../hssf/record/formula/functions/Choose.java | 13 + .../hssf/record/formula/functions/Clean.java | 13 + .../hssf/record/formula/functions/Code.java | 13 + .../hssf/record/formula/functions/Column.java | 13 + .../record/formula/functions/Columns.java | 13 + .../hssf/record/formula/functions/Combin.java | 13 + .../record/formula/functions/Concatenate.java | 13 + .../record/formula/functions/Confidence.java | 13 + .../hssf/record/formula/functions/Correl.java | 13 + .../hssf/record/formula/functions/Cos.java | 62 ++ .../hssf/record/formula/functions/Cosh.java | 64 ++ .../hssf/record/formula/functions/Count.java | 13 + .../hssf/record/formula/functions/Counta.java | 13 + .../record/formula/functions/Countblank.java | 13 + .../record/formula/functions/Countif.java | 13 + .../hssf/record/formula/functions/Covar.java | 13 + .../formula/functions/Createobject.java | 13 + .../record/formula/functions/Critbinom.java | 13 + .../formula/functions/Customrepeat.java | 13 + .../record/formula/functions/Customundo.java | 13 + .../hssf/record/formula/functions/Date.java | 13 + .../record/formula/functions/Datedif.java | 13 + .../record/formula/functions/Datestring.java | 13 + .../record/formula/functions/Datevalue.java | 13 + .../record/formula/functions/Daverage.java | 13 + .../hssf/record/formula/functions/Day.java | 13 + .../record/formula/functions/Days360.java | 13 + .../poi/hssf/record/formula/functions/Db.java | 13 + .../hssf/record/formula/functions/Dbcs.java | 13 + .../hssf/record/formula/functions/Dcount.java | 13 + .../record/formula/functions/Dcounta.java | 13 + .../hssf/record/formula/functions/Ddb.java | 13 + .../functions/DefaultFunctionImpl.java | 25 + .../record/formula/functions/Degrees.java | 63 ++ .../record/formula/functions/Deletebar.java | 13 + .../formula/functions/Deletecommand.java | 13 + .../record/formula/functions/Deletemenu.java | 13 + .../formula/functions/Deletetoolbar.java | 13 + .../hssf/record/formula/functions/Deref.java | 13 + .../hssf/record/formula/functions/Devsq.java | 13 + .../hssf/record/formula/functions/Dget.java | 13 + .../record/formula/functions/Dialogbox.java | 13 + .../record/formula/functions/Directory.java | 13 + .../hssf/record/formula/functions/Dmax.java | 13 + .../hssf/record/formula/functions/Dmin.java | 13 + .../record/formula/functions/Documents.java | 13 + .../hssf/record/formula/functions/Dollar.java | 61 ++ .../record/formula/functions/Dproduct.java | 13 + .../hssf/record/formula/functions/Dstdev.java | 13 + .../record/formula/functions/Dstdevp.java | 13 + .../hssf/record/formula/functions/Dsum.java | 13 + .../hssf/record/formula/functions/Dvar.java | 13 + .../hssf/record/formula/functions/Dvarp.java | 13 + .../hssf/record/formula/functions/Echo.java | 13 + .../formula/functions/Enablecommand.java | 13 + .../record/formula/functions/Enabletool.java | 13 + .../hssf/record/formula/functions/Error.java | 13 + .../record/formula/functions/Errortype.java | 13 + .../record/formula/functions/Evaluate.java | 13 + .../hssf/record/formula/functions/Even.java | 71 ++ .../hssf/record/formula/functions/Exact.java | 13 + .../hssf/record/formula/functions/Exec.java | 13 + .../record/formula/functions/Execute.java | 13 + .../hssf/record/formula/functions/Exp.java | 62 ++ .../record/formula/functions/Expondist.java | 13 + .../formula/functions/Externalflag.java | 13 + .../hssf/record/formula/functions/Fact.java | 13 + .../hssf/record/formula/functions/False.java | 30 + .../hssf/record/formula/functions/Fclose.java | 13 + .../hssf/record/formula/functions/Fdist.java | 13 + .../hssf/record/formula/functions/Files.java | 13 + .../hssf/record/formula/functions/Find.java | 13 + .../hssf/record/formula/functions/Findb.java | 13 + .../hssf/record/formula/functions/Finv.java | 13 + .../hssf/record/formula/functions/Fisher.java | 13 + .../record/formula/functions/Fisherinv.java | 13 + .../hssf/record/formula/functions/Fixed.java | 13 + .../hssf/record/formula/functions/Floor.java | 13 + .../hssf/record/formula/functions/Fopen.java | 13 + .../record/formula/functions/Forecast.java | 13 + .../formula/functions/Formulaconvert.java | 13 + .../hssf/record/formula/functions/Fpos.java | 13 + .../hssf/record/formula/functions/Fread.java | 13 + .../record/formula/functions/Freadln.java | 13 + .../record/formula/functions/Frequency.java | 13 + .../hssf/record/formula/functions/Fsize.java | 13 + .../hssf/record/formula/functions/Ftest.java | 13 + .../record/formula/functions/Function.java | 17 + .../poi/hssf/record/formula/functions/Fv.java | 13 + .../hssf/record/formula/functions/Fwrite.java | 13 + .../record/formula/functions/Fwriteln.java | 13 + .../record/formula/functions/Gammadist.java | 13 + .../record/formula/functions/Gammainv.java | 13 + .../record/formula/functions/Gammaln.java | 13 + .../record/formula/functions/Geomean.java | 13 + .../hssf/record/formula/functions/Getbar.java | 13 + .../record/formula/functions/Getcell.java | 13 + .../formula/functions/Getchartitem.java | 13 + .../hssf/record/formula/functions/Getdef.java | 13 + .../record/formula/functions/Getdocument.java | 13 + .../record/formula/functions/Getformula.java | 13 + .../record/formula/functions/Getlinkinfo.java | 13 + .../record/formula/functions/Getmovie.java | 13 + .../record/formula/functions/Getname.java | 13 + .../record/formula/functions/Getnote.java | 13 + .../record/formula/functions/Getobject.java | 13 + .../formula/functions/Getpivotdata.java | 13 + .../formula/functions/Getpivotfield.java | 13 + .../formula/functions/Getpivotitem.java | 13 + .../formula/functions/Getpivottable.java | 13 + .../record/formula/functions/Gettool.java | 13 + .../record/formula/functions/Gettoolbar.java | 13 + .../record/formula/functions/Getwindow.java | 13 + .../record/formula/functions/Getworkbook.java | 13 + .../formula/functions/Getworkspace.java | 13 + .../hssf/record/formula/functions/Goto.java | 13 + .../hssf/record/formula/functions/Group.java | 13 + .../hssf/record/formula/functions/Growth.java | 13 + .../hssf/record/formula/functions/Halt.java | 13 + .../record/formula/functions/Harmean.java | 13 + .../hssf/record/formula/functions/Help.java | 13 + .../record/formula/functions/Hlookup.java | 13 + .../hssf/record/formula/functions/Hour.java | 13 + .../record/formula/functions/Hyperlink.java | 13 + .../record/formula/functions/Hypgeomdist.java | 13 + .../hssf/record/formula/functions/Index.java | 13 + .../record/formula/functions/Indirect.java | 13 + .../hssf/record/formula/functions/Info.java | 13 + .../record/formula/functions/Initiate.java | 13 + .../hssf/record/formula/functions/Input.java | 13 + .../hssf/record/formula/functions/Int.java | 64 ++ .../record/formula/functions/Intercept.java | 13 + .../hssf/record/formula/functions/Ipmt.java | 13 + .../hssf/record/formula/functions/Irr.java | 13 + .../record/formula/functions/IsError.java | 13 + .../hssf/record/formula/functions/IsNa.java | 13 + .../record/formula/functions/Isblank.java | 13 + .../hssf/record/formula/functions/Iserr.java | 13 + .../record/formula/functions/Islogical.java | 13 + .../record/formula/functions/Isnontext.java | 13 + .../record/formula/functions/Isnumber.java | 13 + .../hssf/record/formula/functions/Ispmt.java | 13 + .../hssf/record/formula/functions/Isref.java | 13 + .../hssf/record/formula/functions/Istext.java | 13 + .../hssf/record/formula/functions/Kurt.java | 13 + .../hssf/record/formula/functions/Large.java | 13 + .../record/formula/functions/Lasterror.java | 13 + .../hssf/record/formula/functions/Left.java | 13 + .../hssf/record/formula/functions/Leftb.java | 13 + .../hssf/record/formula/functions/Len.java | 13 + .../hssf/record/formula/functions/Lenb.java | 13 + .../hssf/record/formula/functions/Linest.java | 13 + .../hssf/record/formula/functions/Links.java | 13 + .../poi/hssf/record/formula/functions/Ln.java | 62 ++ .../hssf/record/formula/functions/Log.java | 83 +++ .../hssf/record/formula/functions/Log10.java | 64 ++ .../hssf/record/formula/functions/Logest.java | 13 + .../hssf/record/formula/functions/Loginv.java | 13 + .../record/formula/functions/Lognormdist.java | 13 + .../hssf/record/formula/functions/Lookup.java | 13 + .../hssf/record/formula/functions/Lower.java | 13 + .../hssf/record/formula/functions/Match.java | 13 + .../hssf/record/formula/functions/Max.java | 13 + .../hssf/record/formula/functions/Maxa.java | 13 + .../record/formula/functions/Mdeterm.java | 13 + .../hssf/record/formula/functions/Median.java | 13 + .../hssf/record/formula/functions/Mid.java | 13 + .../hssf/record/formula/functions/Midb.java | 13 + .../hssf/record/formula/functions/Min.java | 13 + .../hssf/record/formula/functions/Mina.java | 13 + .../hssf/record/formula/functions/Minute.java | 13 + .../record/formula/functions/Minverse.java | 13 + .../hssf/record/formula/functions/Mirr.java | 13 + .../hssf/record/formula/functions/Mmult.java | 13 + .../hssf/record/formula/functions/Mod.java | 13 + .../hssf/record/formula/functions/Mode.java | 13 + .../hssf/record/formula/functions/Month.java | 13 + .../formula/functions/Moviecommand.java | 13 + .../poi/hssf/record/formula/functions/N.java | 13 + .../poi/hssf/record/formula/functions/Na.java | 13 + .../hssf/record/formula/functions/Names.java | 13 + .../formula/functions/Negbinomdist.java | 13 + .../record/formula/functions/Normdist.java | 13 + .../record/formula/functions/Norminv.java | 13 + .../record/formula/functions/Normsdist.java | 13 + .../record/formula/functions/Normsinv.java | 13 + .../hssf/record/formula/functions/Not.java | 14 + .../hssf/record/formula/functions/Note.java | 13 + .../hssf/record/formula/functions/Now.java | 13 + .../hssf/record/formula/functions/Nper.java | 13 + .../hssf/record/formula/functions/Npv.java | 13 + .../formula/functions/Numberstring.java | 13 + .../formula/functions/NumericFunction.java | 60 ++ .../hssf/record/formula/functions/Odd.java | 71 ++ .../hssf/record/formula/functions/Offset.java | 13 + .../record/formula/functions/Opendialog.java | 13 + .../formula/functions/Optionslistsget.java | 13 + .../poi/hssf/record/formula/functions/Or.java | 69 ++ .../hssf/record/formula/functions/Pause.java | 13 + .../record/formula/functions/Pearson.java | 13 + .../record/formula/functions/Percentile.java | 13 + .../record/formula/functions/Percentrank.java | 13 + .../hssf/record/formula/functions/Permut.java | 13 + .../record/formula/functions/Phonetic.java | 13 + .../poi/hssf/record/formula/functions/Pi.java | 32 + .../formula/functions/Pivotadddata.java | 13 + .../hssf/record/formula/functions/Pmt.java | 13 + .../record/formula/functions/Poisson.java | 13 + .../hssf/record/formula/functions/Poke.java | 13 + .../hssf/record/formula/functions/Power.java | 78 ++ .../hssf/record/formula/functions/Ppmt.java | 13 + .../record/formula/functions/Presstool.java | 13 + .../hssf/record/formula/functions/Prob.java | 13 + .../record/formula/functions/Product.java | 13 + .../hssf/record/formula/functions/Proper.java | 13 + .../poi/hssf/record/formula/functions/Pv.java | 13 + .../record/formula/functions/Quartile.java | 13 + .../record/formula/functions/Radians.java | 63 ++ .../hssf/record/formula/functions/Rand.java | 30 + .../hssf/record/formula/functions/Rank.java | 13 + .../hssf/record/formula/functions/Rate.java | 13 + .../record/formula/functions/Reftext.java | 13 + .../record/formula/functions/Register.java | 13 + .../record/formula/functions/Registerid.java | 13 + .../hssf/record/formula/functions/Relref.java | 13 + .../formula/functions/Renamecommand.java | 13 + .../record/formula/functions/Replace.java | 13 + .../record/formula/functions/Replaceb.java | 13 + .../hssf/record/formula/functions/Rept.java | 13 + .../record/formula/functions/Request.java | 13 + .../formula/functions/Resettoolbar.java | 13 + .../record/formula/functions/Restart.java | 13 + .../hssf/record/formula/functions/Result.java | 13 + .../hssf/record/formula/functions/Resume.java | 13 + .../hssf/record/formula/functions/Right.java | 13 + .../hssf/record/formula/functions/Rightb.java | 13 + .../hssf/record/formula/functions/Roman.java | 13 + .../hssf/record/formula/functions/Round.java | 13 + .../record/formula/functions/Rounddown.java | 13 + .../record/formula/functions/Roundup.java | 13 + .../hssf/record/formula/functions/Row.java | 13 + .../hssf/record/formula/functions/Rows.java | 13 + .../hssf/record/formula/functions/Rsq.java | 13 + .../record/formula/functions/Savedialog.java | 13 + .../record/formula/functions/Savetoolbar.java | 13 + .../record/formula/functions/Scenarioget.java | 13 + .../hssf/record/formula/functions/Search.java | 13 + .../record/formula/functions/Searchb.java | 13 + .../hssf/record/formula/functions/Second.java | 13 + .../record/formula/functions/Selection.java | 13 + .../hssf/record/formula/functions/Series.java | 13 + .../record/formula/functions/Setname.java | 13 + .../record/formula/functions/Setvalue.java | 13 + .../record/formula/functions/Showbar.java | 13 + .../hssf/record/formula/functions/Sign.java | 68 ++ .../hssf/record/formula/functions/Sin.java | 62 ++ .../hssf/record/formula/functions/Sinh.java | 64 ++ .../hssf/record/formula/functions/Skew.java | 13 + .../hssf/record/formula/functions/Sln.java | 13 + .../hssf/record/formula/functions/Slope.java | 13 + .../hssf/record/formula/functions/Small.java | 13 + .../formula/functions/Spellingcheck.java | 13 + .../hssf/record/formula/functions/Sqrt.java | 62 ++ .../record/formula/functions/Standardize.java | 13 + .../hssf/record/formula/functions/Stdev.java | 13 + .../hssf/record/formula/functions/Stdeva.java | 13 + .../hssf/record/formula/functions/Stdevp.java | 13 + .../record/formula/functions/Stdevpa.java | 13 + .../hssf/record/formula/functions/Step.java | 13 + .../hssf/record/formula/functions/Steyx.java | 13 + .../record/formula/functions/Substitute.java | 13 + .../record/formula/functions/Subtotal.java | 13 + .../hssf/record/formula/functions/Sum.java | 13 + .../hssf/record/formula/functions/Sumif.java | 13 + .../record/formula/functions/Sumproduct.java | 13 + .../hssf/record/formula/functions/Sumsq.java | 13 + .../record/formula/functions/Sumx2my2.java | 13 + .../record/formula/functions/Sumx2py2.java | 13 + .../record/formula/functions/Sumxmy2.java | 13 + .../hssf/record/formula/functions/Syd.java | 13 + .../poi/hssf/record/formula/functions/T.java | 13 + .../hssf/record/formula/functions/Tan.java | 62 ++ .../hssf/record/formula/functions/Tanh.java | 64 ++ .../hssf/record/formula/functions/Tdist.java | 13 + .../record/formula/functions/Terminate.java | 13 + .../hssf/record/formula/functions/Text.java | 13 + .../record/formula/functions/Textbox.java | 13 + .../record/formula/functions/Textref.java | 13 + .../hssf/record/formula/functions/Time.java | 13 + .../record/formula/functions/Timevalue.java | 13 + .../hssf/record/formula/functions/Tinv.java | 13 + .../hssf/record/formula/functions/Today.java | 13 + .../record/formula/functions/Transpose.java | 13 + .../hssf/record/formula/functions/Trend.java | 13 + .../hssf/record/formula/functions/Trim.java | 13 + .../record/formula/functions/Trimmean.java | 13 + .../hssf/record/formula/functions/True.java | 30 + .../hssf/record/formula/functions/Trunc.java | 13 + .../hssf/record/formula/functions/Ttest.java | 13 + .../hssf/record/formula/functions/Type.java | 13 + .../record/formula/functions/Unregister.java | 13 + .../hssf/record/formula/functions/Upper.java | 13 + .../record/formula/functions/Usdollar.java | 13 + .../hssf/record/formula/functions/Value.java | 13 + .../hssf/record/formula/functions/Var.java | 13 + .../hssf/record/formula/functions/Vara.java | 13 + .../hssf/record/formula/functions/Varp.java | 13 + .../hssf/record/formula/functions/Varpa.java | 13 + .../hssf/record/formula/functions/Vdb.java | 13 + .../record/formula/functions/Viewget.java | 13 + .../record/formula/functions/Vlookup.java | 13 + .../record/formula/functions/Volatile.java | 13 + .../record/formula/functions/Weekday.java | 13 + .../record/formula/functions/Weibull.java | 13 + .../record/formula/functions/Windows.java | 13 + .../record/formula/functions/Windowtitle.java | 13 + .../hssf/record/formula/functions/Year.java | 13 + .../hssf/record/formula/functions/Ztest.java | 13 + .../hssf/usermodel/HSSFFormulaEvaluator.java | 699 ++++++++++++++++++ .../poi/hssf/data/FormulaEvalTestData.xls | Bin 0 -> 92160 bytes .../formula/eval/GenericFormulaTestCase.java | 131 ++++ .../record/formula/eval/TestEverything.java | 33 + .../formula/functions/TestEverything.java | 26 + 396 files changed, 10432 insertions(+) create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AddEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area2DEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area3DEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AreaEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BlankEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BoolEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ConcatEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/DivideEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/EqualEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ErrorEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Eval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FuncVarEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FunctionEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterEqualEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterThanEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessEqualEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessThanEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/MultiplyEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NotEqualEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumberEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericOperationEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericValueEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/OperationEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/PowerEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref2DEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref3DEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RefEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RelationalOperationEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringOperationEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringValueEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/SubtractEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryMinusEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryPlusEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEval.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEvalToNumericXlator.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Abs.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Absref.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acos.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acosh.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Activecell.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addcommand.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addmenu.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Address.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addtoolbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/And.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Apptitle.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Areas.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Argument.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Asc.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Asin.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Asinh.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Atan.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Atan2.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Atanh.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Avedev.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Average.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Averagea.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Betadist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Betainv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Binomdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/BooleanFunction.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Call.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Caller.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cancelkey.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ceiling.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cell.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Char.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Checkcommand.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chidist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chiinv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chitest.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Choose.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Clean.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Code.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Column.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Columns.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Combin.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Concatenate.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Confidence.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Correl.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cos.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cosh.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Count.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Counta.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countblank.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countif.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Covar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Createobject.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Critbinom.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customrepeat.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customundo.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Date.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datedif.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datestring.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datevalue.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Daverage.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Day.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Days360.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Db.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dbcs.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcount.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcounta.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ddb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/DefaultFunctionImpl.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Degrees.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletebar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletecommand.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletemenu.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletetoolbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deref.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Devsq.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dget.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dialogbox.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Directory.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmax.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmin.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Documents.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dollar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dproduct.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdev.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdevp.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dsum.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvarp.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Echo.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enablecommand.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enabletool.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Error.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Errortype.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Evaluate.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Even.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exact.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exec.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Execute.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exp.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Expondist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Externalflag.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fact.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/False.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fclose.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Files.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Find.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Findb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Finv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisher.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisherinv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fixed.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Floor.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fopen.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Forecast.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Formulaconvert.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fpos.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fread.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Freadln.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Frequency.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fsize.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ftest.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Function.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwrite.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwriteln.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammadist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammainv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammaln.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Geomean.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getcell.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getchartitem.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdef.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdocument.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getformula.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getlinkinfo.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getmovie.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getname.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getnote.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getobject.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotdata.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotfield.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotitem.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivottable.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettool.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettoolbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getwindow.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkbook.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkspace.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Goto.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Group.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Growth.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Halt.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Harmean.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Help.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hlookup.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hour.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hyperlink.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hypgeomdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Index.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Indirect.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Info.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Initiate.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Input.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Int.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Intercept.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ipmt.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Irr.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsError.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsNa.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isblank.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Iserr.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Islogical.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnontext.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnumber.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ispmt.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isref.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Istext.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Kurt.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Large.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lasterror.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Left.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Leftb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Len.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lenb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Linest.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Links.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ln.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log10.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Logest.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Loginv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lognormdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lookup.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lower.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Match.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Max.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Maxa.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mdeterm.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Median.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mid.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Midb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Min.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mina.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minute.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minverse.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mirr.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mmult.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mod.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mode.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Month.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Moviecommand.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/N.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Na.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Names.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Negbinomdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Norminv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsinv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Not.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Note.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Now.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Nper.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Npv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Numberstring.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/NumericFunction.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Odd.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Offset.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Opendialog.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Optionslistsget.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Or.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Pause.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Pearson.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Percentile.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Percentrank.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Permut.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Phonetic.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Pi.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Pivotadddata.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Pmt.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Poisson.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Poke.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Power.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ppmt.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Presstool.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Prob.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Product.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Proper.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Pv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Quartile.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Radians.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rand.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rank.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rate.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Reftext.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Register.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Registerid.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Relref.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Renamecommand.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Replace.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Replaceb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rept.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Request.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Resettoolbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Restart.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Result.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Resume.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Right.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rightb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Roman.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Round.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rounddown.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Roundup.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Row.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rows.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Rsq.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Savedialog.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Savetoolbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Scenarioget.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Search.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Searchb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Second.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Selection.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Series.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Setname.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Setvalue.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Showbar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sign.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sin.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sinh.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Skew.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sln.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Slope.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Small.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Spellingcheck.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sqrt.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Standardize.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Stdev.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Stdeva.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Stdevp.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Stdevpa.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Step.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Steyx.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Substitute.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Subtotal.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sum.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sumif.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sumproduct.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sumsq.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sumx2my2.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sumx2py2.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Sumxmy2.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Syd.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/T.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Tan.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Tanh.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Tdist.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Terminate.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Text.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Textbox.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Textref.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Time.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Timevalue.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Tinv.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Today.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Transpose.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Trend.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Trim.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Trimmean.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/True.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Trunc.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ttest.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Type.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Unregister.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Upper.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Usdollar.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Value.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Var.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Vara.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Varp.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Varpa.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Vdb.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Viewget.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Vlookup.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Volatile.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Weekday.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Weibull.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Windows.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Windowtitle.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Year.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ztest.java create mode 100644 src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java create mode 100644 src/scratchpad/testcases/org/apache/poi/hssf/data/FormulaEvalTestData.xls create mode 100644 src/scratchpad/testcases/org/apache/poi/hssf/record/formula/eval/GenericFormulaTestCase.java create mode 100644 src/scratchpad/testcases/org/apache/poi/hssf/record/formula/eval/TestEverything.java create mode 100644 src/scratchpad/testcases/org/apache/poi/hssf/record/formula/functions/TestEverything.java diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AddEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AddEval.java new file mode 100644 index 0000000000..bc993a662f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AddEval.java @@ -0,0 +1,81 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.AddPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * This is a documentation of the observed behaviour of + * the '+' operator in Excel: + *
    + *
  1. 1+TRUE = 2 + *
  2. 1+FALSE = 1 + *
  3. 1+"true" = #VALUE! + *
  4. 1+"1" = 2 + *
  5. 1+A1 = #VALUE if A1 contains "1" + *
  6. 1+A1 = 2 if A1 contains ="1" + *
  7. 1+A1 = 2 if A1 contains TRUE or =TRUE + *
  8. 1+A1 = #VALUE! if A1 contains "TRUE" or ="TRUE" + */ +public class AddEval extends NumericOperationEval { + + private AddPtg delegate; + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + public AddEval(Ptg ptg) { + delegate = (AddPtg) ptg; + } + + public ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + Eval retval = null; + double d = 0; + switch (operands.length) { + default: // will rarely happen. currently the parser itself fails. + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 2: + for (int i = 0, iSize = 2; retval==null && i < iSize; i++) { + ValueEval ve = singleOperandEvaluate(operands[i], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d += ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } // end for inside case + } // end switch + + if (retval == null) { + retval = Double.isNaN(d) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area2DEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area2DEval.java new file mode 100644 index 0000000000..4156a3ce38 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area2DEval.java @@ -0,0 +1,75 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.AreaPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Area2DEval implements AreaEval { + + private AreaPtg delegate; + + private ValueEval[] values; + + public Area2DEval(Ptg ptg, ValueEval[] values) { + this.delegate = (AreaPtg) ptg; + this.values = values; + } + + public short getFirstColumn() { + return delegate.getFirstColumn(); + } + + public int getFirstRow() { + return delegate.getFirstRow(); + } + + public short getLastColumn() { + return delegate.getLastColumn(); + } + + public int getLastRow() { + return delegate.getLastRow(); + } + + public ValueEval[] getValues() { + return values; + } + + public ValueEval getValueAt(int row, short col) { + ValueEval retval; + int index = ((row-getFirstRow())*(getLastColumn()-getFirstColumn()+1))+(col-getFirstColumn()); + if (index <0 || index >= values.length) + retval = ErrorEval.VALUE_INVALID; + else + retval = values[index]; + return retval; + } + + public boolean contains(int row, short col) { + return (getFirstRow() <= row) && (getLastRow() >= row) + && (getFirstColumn() <= col) && (getLastColumn() >= col); + } + + public boolean containsRow(int row) { + return (getFirstRow() <= row) && (getLastRow() >= row); + } + + public boolean containsColumn(short col) { + return (getFirstColumn() <= col) && (getLastColumn() >= col); + } + + public boolean isColumn() { + return delegate.getFirstColumn() == delegate.getLastColumn(); + } + + public boolean isRow() { + return delegate.getFirstRow() == delegate.getLastRow(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area3DEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area3DEval.java new file mode 100644 index 0000000000..50d7820da8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Area3DEval.java @@ -0,0 +1,77 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Area3DPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Area3DEval implements AreaEval { + + private Area3DPtg delegate; + + private ValueEval[] values; + + public Area3DEval(Ptg ptg, ValueEval[] values) { + this.values = values; + this.delegate = (Area3DPtg) ptg; + } + + public short getFirstColumn() { + return delegate.getFirstColumn(); + } + + public int getFirstRow() { + return delegate.getFirstRow(); + } + + public short getLastColumn() { + return delegate.getLastColumn(); + } + + public int getLastRow() { + return delegate.getLastRow(); + } + + public ValueEval[] getValues() { + return values; + } + + public ValueEval getValueAt(int row, short col) { + ValueEval retval; + int index = (row-getFirstRow())*(col-getFirstColumn()); + if (index <0 || index >= values.length) + retval = ErrorEval.VALUE_INVALID; + else + retval = values[index]; + return retval; + } + + public boolean contains(int row, short col) { + return (getFirstRow() <= row) && (getLastRow() >= row) + && (getFirstColumn() <= col) && (getLastColumn() >= col); + } + + public boolean containsRow(int row) { + return (getFirstRow() <= row) && (getLastRow() >= row); + } + + public boolean containsColumn(short col) { + return (getFirstColumn() <= col) && (getLastColumn() >= col); + } + + + public boolean isColumn() { + return delegate.getFirstColumn() == delegate.getLastColumn(); + } + + public boolean isRow() { + return delegate.getFirstRow() == delegate.getLastRow(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AreaEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AreaEval.java new file mode 100644 index 0000000000..3db24b7c11 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/AreaEval.java @@ -0,0 +1,100 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public interface AreaEval extends ValueEval { + + /** + * returns the 0-based index of the first row in + * this area. + * @return + */ + public int getFirstRow(); + + /** + * returns the 0-based index of the last row in + * this area. + * @return + */ + public int getLastRow(); + + /** + * returns the 0-based index of the first col in + * this area. + * @return + */ + public short getFirstColumn(); + + /** + * returns the 0-based index of the last col in + * this area. + * @return + */ + public short getLastColumn(); + + /** + * returns true if the Area's start and end row indexes + * are same. This result of this method should agree + * with getFirstRow() == getLastRow(). + * @return + */ + public boolean isRow(); + + /** + * returns true if the Area's start and end col indexes + * are same. This result of this method should agree + * with getFirstColumn() == getLastColumn(). + * @return + */ + public boolean isColumn(); + + /** + * The array of values in this area. Although the area + * maybe 1D (ie. isRow() or isColumn() returns true) or 2D + * the returned array is 1D. + * @return + */ + public ValueEval[] getValues(); + + /** + * returns the ValueEval from the values array at the specified + * row and col index. The specified indexes should be absolute indexes + * in the sheet and not relative indexes within the area. Also, + * if contains(row, col) evaluates to true, a null value will + * bre returned. + * @param row + * @param col + * @return + */ + public ValueEval getValueAt(int row, short col); + + /** + * returns true if the cell at row and col specified + * as absolute indexes in the sheet is contained in + * this area. + * @param row + * @param col + * @return + */ + public boolean contains(int row, short col); + + /** + * returns true if the specified col is in range + * @param col + * @return + */ + public boolean containsColumn(short col); + + /** + * returns true if the specified row is in range + * @param row + * @return + */ + public boolean containsRow(int row); +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BlankEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BlankEval.java new file mode 100644 index 0000000000..76c6d41d72 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BlankEval.java @@ -0,0 +1,17 @@ +/* + * Created on May 9, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > This class is a + * marker class. It is a special value for empty cells. + */ +public class BlankEval implements ValueEval { + + public static BlankEval INSTANCE = new BlankEval(); + + private BlankEval() { + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BoolEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BoolEval.java new file mode 100644 index 0000000000..f7b22b4df0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/BoolEval.java @@ -0,0 +1,41 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.BoolPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class BoolEval implements NumericValueEval, StringValueEval { + + private boolean value; + + public static final BoolEval FALSE = new BoolEval(false); + + public static final BoolEval TRUE = new BoolEval(true); + + public BoolEval(Ptg ptg) { + this.value = ((BoolPtg) ptg).getValue(); + } + + private BoolEval(boolean value) { + this.value = value; + } + + public boolean getBooleanValue() { + return value; + } + + public double getNumberValue() { + return value ? (short) 1 : (short) 0; + } + + public String getStringValue() { + return value ? "TRUE" : "FALSE"; + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ConcatEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ConcatEval.java new file mode 100644 index 0000000000..8b5b882efe --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ConcatEval.java @@ -0,0 +1,61 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.ConcatPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class ConcatEval extends StringOperationEval { + + private ConcatPtg delegate; + + public ConcatEval(Ptg ptg) { + this.delegate = (ConcatPtg) ptg; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + Eval retval = null; + StringBuffer sb = null; + + switch (operands.length) { + default: // paranoid check :) + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 2: + sb = new StringBuffer(); + for (int i = 0, iSize = 2; retval == null && i < iSize; i++) { + + ValueEval ve = singleOperandEvaluate(operands[i], srcRow, srcCol); + if (ve instanceof StringValueEval) { + StringValueEval sve = (StringValueEval) ve; + sb.append(sve.getStringValue()); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { // must be an error eval + retval = ve; + } + } + } + + if (retval == null) { + retval = new StringEval(sb.toString()); + } + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/DivideEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/DivideEval.java new file mode 100644 index 0000000000..3b9d193bc1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/DivideEval.java @@ -0,0 +1,86 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.DividePtg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class DivideEval extends NumericOperationEval { + + private DividePtg delegate; + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + public DivideEval(Ptg ptg) { + delegate = (DividePtg) ptg; + } + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + Eval retval = null; + double d0 = 0; + double d1 = 0; + switch (operands.length) { + default: // will rarely happen. currently the parser itself fails. + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 2: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d0 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + + if (retval == null) { // no error yet + ve = singleOperandEvaluate(operands[1], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d1 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + } // end switch + + if (retval == null) { + retval = (d1 == 0) + ? ErrorEval.DIV_ZERO + : (Double.isNaN(d0) || Double.isNaN(d1)) + ? (ValueEval) ErrorEval.VALUE_INVALID + : new NumberEval(d0 / d1); + } + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/EqualEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/EqualEval.java new file mode 100644 index 0000000000..0fdd8cb03f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/EqualEval.java @@ -0,0 +1,51 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.EqualPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class EqualEval extends RelationalOperationEval { + + private EqualPtg delegate; + + public EqualEval(Ptg ptg) { + this.delegate = (EqualPtg) ptg; + } + + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + + RelationalValues rvs = super.doEvaluate(operands, srcRow, srcCol); + retval = rvs.ee; + int result = 0; + if (retval == null) { + result = doComparison(rvs.bs); + if (result == 0) { + result = doComparison(rvs.ss); + } + if (result == 0) { + result = doComparison(rvs.ds); + } + + retval = (result == 0) ? BoolEval.TRUE : BoolEval.FALSE; + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ErrorEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ErrorEval.java new file mode 100644 index 0000000000..e1c8a7fcc0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ErrorEval.java @@ -0,0 +1,609 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + * Error code reference from OpenOffice documentation:
    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    + *

    + * Error Code + *

    + *
    + *

    + * Message + *

    + *
    + *

    + * Explanation + *

    + *
    + *

    + * 501 + *

    + *
    + *

    + * Invalid character + *

    + *
    + *

    + * Character in a formula is not valid, for example, "=1Eq" instead of + * "=1E2". + *

    + *
    + *

    + * 502 + *

    + *
    + *

    + * Invalid argument + *

    + *
    + *

    + * Function argument is not valid, for example, a negative number for the root + * function. + *

    + *
    + *

    + * 503 + *

    + *
    + *

    + * Invalid floating point operation + *

    + *
    + *

    + * Division by 0, or another calculation that results in an overflow of the + * defined value range. + *

    + *
    + *

    + * 504 + *

    + *
    + *

    + * Parameter list error + *

    + *
    + *

    + * Function parameter is not valid, for example, text instead of a number, or a + * domain reference instead of cell reference. + *

    + *
    + *

    + * 505 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * Not used + *

    + *
    + *

    + * 506 + *

    + *
    + *

    + * Invalid semicolon + *

    + *
    + *

    + * Not used + *

    + *
    + *

    + * 507 + *

    + *
    + *

    + * Error: Pair missing + *

    + *
    + *

    + * Not used + *

    + *
    + *

    + * 508 + *

    + *
    + *

    + * Error: Pair missing + *

    + *
    + *

    + * Missing bracket, for example, closing brackets, but no opening brackets + *

    + *
    + *

    + * 509 + *

    + *
    + *

    + * Missing operator + *

    + *
    + *

    + * Operator is missing, for example, "=2(3+4) * ", where the operator + * between "2" and "(" is missing. + *

    + *
    + *

    + * 510 + *

    + *
    + *

    + * Missing variable + *

    + *
    + *

    + * Variable is missing, for example when two operators are together + * "=1+*2". + *

    + *
    + *

    + * 511 + *

    + *
    + *

    + * Missing variable + *

    + *
    + *

    + * Function requires more variables than are provided, for example, AND() and + * OR(). + *

    + *
    + *

    + * 512 + *

    + *
    + *

    + * Formula overflow + *

    + *
    + *

    + * Compiler: the total number of internal tokens, (that is, operators, + * variables, brackets) in the formula exceeds 512. Interpreter: the + * total number of matrices that the formula creates exceeds 150. This includes + * basic functions that receive too large an array as a parameter (max. 0xFFFE, + * for example, 65534 bytes). + *

    + *
    + *

    + * 513 + *

    + *
    + *

    + * String overflow + *

    + *
    + *

    + * Compiler: an identifier in the formula exceeds 64 KB in size. + * Interpreter: a result of a string operation exceeds 64 KB in size. + *

    + *
    + *

    + * 514 + *

    + *
    + *

    + * Internal overflow + *

    + *
    + *

    + * Sort operation attempted on too much numerical data (max. 100000) or a + * calculation stack overflow. + *

    + *
    + *

    + * 515 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * Not used + *

    + *
    + *

    + * 516 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * Matrix is expected on the calculation stack, but is not available. + *

    + *
    + *

    + * 517 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * Unknown code, for example, a document with a newer function is loaded in an + * older version that does not contain the function. + *

    + *
    + *

    + * 518 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * Variable is not available + *

    + *
    + *

    + * 519 + *

    + *
    + *

    + * No result (#VALUE is in the cell rather than Err:519!) + *

    + *
    + *

    + * Formula yields a value that does not corresponds to the definition, or a cell + * that is referenced in the formula contains text instead of a number. + *

    + *
    + *

    + * 520 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * Compiler creates an unknown compiler code. + *

    + *
    + *

    + * 521 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * No result. + *

    + *
    + *

    + * 522 + *

    + *
    + *

    + * Circular reference + *

    + *
    + *

    + * Formula refers directly or indirectly to itself and the iterations option is + * not selected under Tools - Options - Table Document - Calculate. + *

    + *
    + *

    + * 523 + *

    + *
    + *

    + * The calculation procedure does not converge + *

    + *
    + *

    + * Financial statistics function missed a targeted value or iterations of + * circular references do not reach the minimum change within the maximum steps + * that are set. + *

    + *
    + *

    + * 524 + *

    + *
    + *

    + * invalid references + * (instead of Err:524 cell contains #REF) + *

    + *
    + *

    + * Compiler: a column or row description name could not be resolved. + * Interpreter: in a formula, the column, row, or sheet that contains a + * referenced cell is missing. + *

    + *
    + *

    + * 525 + *

    + *
    + *

    + * invalid names (instead of + * Err:525 cell contains #NAME?) + *

    + *
    + *

    + * An identifier could not be evaluated, for example, no valid reference, no + * valid domain name, no column/row label, no macro, incorrect decimal divider, + * add-in not found. + *

    + *
    + *

    + * 526 + *

    + *
    + *

    + * Internal syntax error + *

    + *
    + *

    + * Obsolete, no longer used, but could come from old documents if the result is + * a formula from a domain. + *

    + *
    + *

    + * 527 + *

    + *
    + *

    + * Internal overflow + *

    + *
    + *

    + * Interpreter: References, such as when a cell references a cell, are + * too encapsulated. + *

    + *
    + * + */ +public class ErrorEval implements ValueEval { + + private int errorCode; + + // Oo std error codes + public static final ErrorEval ERROR_501 = new ErrorEval(501); + + public static final ErrorEval ERROR_502 = new ErrorEval(502); + + public static final ErrorEval ERROR_503 = new ErrorEval(503); + + public static final ErrorEval ERROR_504 = new ErrorEval(504); + + public static final ErrorEval ERROR_505 = new ErrorEval(505); + + public static final ErrorEval ERROR_506 = new ErrorEval(506); + + public static final ErrorEval ERROR_507 = new ErrorEval(507); + + public static final ErrorEval ERROR_508 = new ErrorEval(508); + + public static final ErrorEval ERROR_509 = new ErrorEval(509); + + public static final ErrorEval ERROR_510 = new ErrorEval(510); + + public static final ErrorEval ERROR_511 = new ErrorEval(511); + + public static final ErrorEval ERROR_512 = new ErrorEval(512); + + public static final ErrorEval ERROR_513 = new ErrorEval(513); + + public static final ErrorEval ERROR_514 = new ErrorEval(514); + + public static final ErrorEval ERROR_515 = new ErrorEval(515); + + public static final ErrorEval ERROR_516 = new ErrorEval(516); + + public static final ErrorEval ERROR_517 = new ErrorEval(517); + + public static final ErrorEval ERROR_518 = new ErrorEval(518); + + public static final ErrorEval ERROR_519 = new ErrorEval(519); + + public static final ErrorEval ERROR_520 = new ErrorEval(520); + + public static final ErrorEval ERROR_521 = new ErrorEval(521); + + public static final ErrorEval ERROR_522 = new ErrorEval(522); + + public static final ErrorEval ERROR_523 = new ErrorEval(523); + + public static final ErrorEval ERROR_524 = new ErrorEval(524); + + public static final ErrorEval ERROR_525 = new ErrorEval(525); + + public static final ErrorEval ERROR_526 = new ErrorEval(526); + + public static final ErrorEval ERROR_527 = new ErrorEval(527); + + public static final ErrorEval NAME_INVALID = ERROR_525; + + public static final ErrorEval VALUE_INVALID = ERROR_519; + + + // Non std error codes + public static final ErrorEval UNKNOWN_ERROR = new ErrorEval(-20); + + public static final ErrorEval FUNCTION_NOT_IMPLEMENTED = new ErrorEval(-30); + + public static final ErrorEval REF_INVALID = new ErrorEval(-40); + + public static final ErrorEval NA = new ErrorEval(-50); + + public static final ErrorEval CIRCULAR_REF_ERROR = new ErrorEval(-60); + + public static final ErrorEval DIV_ZERO = new ErrorEval(-70); + + public static final ErrorEval NUM_ERROR = new ErrorEval(-80); + + private ErrorEval(int errorCode) { + this.errorCode = errorCode; + } + + public int getErrorCode() { + return errorCode; + } + + public String getStringValue() { + return "Err:" + Integer.toString(errorCode); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Eval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Eval.java new file mode 100644 index 0000000000..e60e061a6e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Eval.java @@ -0,0 +1,13 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public interface Eval { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FuncVarEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FuncVarEval.java new file mode 100644 index 0000000000..a9ce8d3a61 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FuncVarEval.java @@ -0,0 +1,44 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.AbstractFunctionPtg; +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.functions.Function; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class FuncVarEval extends FunctionEval { + + private AbstractFunctionPtg delegate; + + public FuncVarEval(Ptg funcPtg) { + delegate = (AbstractFunctionPtg) funcPtg; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + Eval retval = null; + Function f = getFunction(); + if (f != null) + retval = f.evaluate(operands, srcRow, srcCol); + else + retval = ErrorEval.FUNCTION_NOT_IMPLEMENTED; + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + + public short getFunctionIndex() { + return delegate.getFunctionIndex(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FunctionEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FunctionEval.java new file mode 100644 index 0000000000..3a487f7a57 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/FunctionEval.java @@ -0,0 +1,379 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.functions.*; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public abstract class FunctionEval implements OperationEval { + protected static Function[] functions = produceFunctions(); + + public Function getFunction() { + short fidx = getFunctionIndex(); + return functions[fidx]; + } + + public abstract short getFunctionIndex(); + + private static Function[] produceFunctions() { + Function[] retval = new Function[368]; + retval[0] = new Count(); // COUNT + retval[1] = null; // Specialflag(); // SPECIALFLAG + retval[2] = new IsNa(); // ISNA + retval[3] = new IsError(); // ISERROR + retval[4] = new Sum(); // SUM + retval[5] = new Average(); // AVERAGE + retval[6] = new Min(); // MIN + retval[7] = new Max(); // MAX + retval[8] = new Row(); // ROW + retval[9] = new Column(); // COLUMN + retval[10] = new Na(); // NA + retval[11] = new Npv(); // NPV + retval[12] = new Stdev(); // STDEV + retval[13] = new Dollar(); // DOLLAR + retval[14] = new Fixed(); // FIXED + retval[15] = new Sin(); // SIN + retval[16] = new Cos(); // COS + retval[17] = new Tan(); // TAN + retval[18] = new Atan(); // ATAN + retval[19] = new Pi(); // PI + retval[20] = new Sqrt(); // SQRT + retval[21] = new Exp(); // EXP + retval[22] = new Ln(); // LN + retval[23] = new Log10(); // LOG10 + retval[24] = new Abs(); // ABS + retval[25] = new Int(); // INT + retval[26] = new Sign(); // SIGN + retval[27] = new Round(); // ROUND + retval[28] = new Lookup(); // LOOKUP + retval[29] = new Index(); // INDEX + retval[30] = new Rept(); // REPT + retval[31] = new Mid(); // MID + retval[32] = new Len(); // LEN + retval[33] = new Value(); // VALUE + retval[34] = new True(); // TRUE + retval[35] = new False(); // FALSE + retval[36] = new And(); // AND + retval[37] = new Or(); // OR + retval[38] = new Not(); // NOT + retval[39] = new Mod(); // MOD + retval[40] = new Dcount(); // DCOUNT + retval[41] = new Dsum(); // DSUM + retval[42] = new Daverage(); // DAVERAGE + retval[43] = new Dmin(); // DMIN + retval[44] = new Dmax(); // DMAX + retval[45] = new Dstdev(); // DSTDEV + retval[46] = new Var(); // VAR + retval[47] = new Dvar(); // DVAR + retval[48] = new Text(); // TEXT + retval[49] = new Linest(); // LINEST + retval[50] = new Trend(); // TREND + retval[51] = new Logest(); // LOGEST + retval[52] = new Growth(); // GROWTH + retval[53] = new Goto(); // GOTO + retval[54] = new Halt(); // HALT + retval[56] = new Pv(); // PV + retval[57] = new Fv(); // FV + retval[58] = new Nper(); // NPER + retval[59] = new Pmt(); // PMT + retval[60] = new Rate(); // RATE + retval[61] = new Mirr(); // MIRR + retval[62] = new Irr(); // IRR + retval[63] = new Rand(); // RAND + retval[64] = new Match(); // MATCH + retval[65] = new Date(); // DATE + retval[66] = new Time(); // TIME + retval[67] = new Day(); // DAY + retval[68] = new Month(); // MONTH + retval[69] = new Year(); // YEAR + retval[70] = new Weekday(); // WEEKDAY + retval[71] = new Hour(); // HOUR + retval[72] = new Minute(); // MINUTE + retval[73] = new Second(); // SECOND + retval[74] = new Now(); // NOW + retval[75] = new Areas(); // AREAS + retval[76] = new Rows(); // ROWS + retval[77] = new Columns(); // COLUMNS + retval[78] = new Offset(); // OFFSET + retval[79] = new Absref(); // ABSREF + retval[80] = new Relref(); // RELREF + retval[81] = new Argument(); // ARGUMENT + retval[82] = new Search(); // SEARCH + retval[83] = new Transpose(); // TRANSPOSE + retval[84] = new org.apache.poi.hssf.record.formula.functions.Error(); // ERROR + retval[85] = new Step(); // STEP + retval[86] = new Type(); // TYPE + retval[87] = new Echo(); // ECHO + retval[88] = new Setname(); // SETNAME + retval[89] = new Caller(); // CALLER + retval[90] = new Deref(); // DEREF + retval[91] = new Windows(); // WINDOWS + retval[92] = new Series(); // SERIES + retval[93] = new Documents(); // DOCUMENTS + retval[94] = new Activecell(); // ACTIVECELL + retval[95] = new Selection(); // SELECTION + retval[96] = new Result(); // RESULT + retval[97] = new Atan2(); // ATAN2 + retval[98] = new Asin(); // ASIN + retval[99] = new Acos(); // ACOS + retval[100] = new Choose(); // CHOOSE + retval[101] = new Hlookup(); // HLOOKUP + retval[102] = new Vlookup(); // VLOOKUP + retval[103] = new Links(); // LINKS + retval[104] = new Input(); // INPUT + retval[105] = new Isref(); // ISREF + retval[106] = new Getformula(); // GETFORMULA + retval[107] = new Getname(); // GETNAME + retval[108] = new Setvalue(); // SETVALUE + retval[109] = new Log(); // LOG + retval[110] = new Exec(); // EXEC + retval[111] = new Char(); // CHAR + retval[112] = new Lower(); // LOWER + retval[113] = new Upper(); // UPPER + retval[114] = new Proper(); // PROPER + retval[115] = new Left(); // LEFT + retval[116] = new Right(); // RIGHT + retval[117] = new Exact(); // EXACT + retval[118] = new Trim(); // TRIM + retval[119] = new Replace(); // REPLACE + retval[120] = new Substitute(); // SUBSTITUTE + retval[121] = new Code(); // CODE + retval[122] = new Names(); // NAMES + retval[123] = new Directory(); // DIRECTORY + retval[124] = new Find(); // FIND + retval[125] = new Cell(); // CELL + retval[126] = new Iserr(); // ISERR + retval[127] = new Istext(); // ISTEXT + retval[128] = new Isnumber(); // ISNUMBER + retval[129] = new Isblank(); // ISBLANK + retval[130] = new T(); // T + retval[131] = new N(); // N + retval[132] = new Fopen(); // FOPEN + retval[133] = new Fclose(); // FCLOSE + retval[134] = new Fsize(); // FSIZE + retval[135] = new Freadln(); // FREADLN + retval[136] = new Fread(); // FREAD + retval[137] = new Fwriteln(); // FWRITELN + retval[138] = new Fwrite(); // FWRITE + retval[139] = new Fpos(); // FPOS + retval[140] = new Datevalue(); // DATEVALUE + retval[141] = new Timevalue(); // TIMEVALUE + retval[142] = new Sln(); // SLN + retval[143] = new Syd(); // SYD + retval[144] = new Ddb(); // DDB + retval[145] = new Getdef(); // GETDEF + retval[146] = new Reftext(); // REFTEXT + retval[147] = new Textref(); // TEXTREF + retval[148] = new Indirect(); // INDIRECT + retval[149] = new Register(); // REGISTER + retval[150] = new Call(); // CALL + retval[151] = new Addbar(); // ADDBAR + retval[152] = new Addmenu(); // ADDMENU + retval[153] = new Addcommand(); // ADDCOMMAND + retval[154] = new Enablecommand(); // ENABLECOMMAND + retval[155] = new Checkcommand(); // CHECKCOMMAND + retval[156] = new Renamecommand(); // RENAMECOMMAND + retval[157] = new Showbar(); // SHOWBAR + retval[158] = new Deletemenu(); // DELETEMENU + retval[159] = new Deletecommand(); // DELETECOMMAND + retval[160] = new Getchartitem(); // GETCHARTITEM + retval[161] = new Dialogbox(); // DIALOGBOX + retval[162] = new Clean(); // CLEAN + retval[163] = new Mdeterm(); // MDETERM + retval[164] = new Minverse(); // MINVERSE + retval[165] = new Mmult(); // MMULT + retval[166] = new Files(); // FILES + retval[167] = new Ipmt(); // IPMT + retval[168] = new Ppmt(); // PPMT + retval[169] = new Counta(); // COUNTA + retval[170] = new Cancelkey(); // CANCELKEY + retval[175] = new Initiate(); // INITIATE + retval[176] = new Request(); // REQUEST + retval[177] = new Poke(); // POKE + retval[178] = new Execute(); // EXECUTE + retval[179] = new Terminate(); // TERMINATE + retval[180] = new Restart(); // RESTART + retval[181] = new Help(); // HELP + retval[182] = new Getbar(); // GETBAR + retval[183] = new Product(); // PRODUCT + retval[184] = new Fact(); // FACT + retval[185] = new Getcell(); // GETCELL + retval[186] = new Getworkspace(); // GETWORKSPACE + retval[187] = new Getwindow(); // GETWINDOW + retval[188] = new Getdocument(); // GETDOCUMENT + retval[189] = new Dproduct(); // DPRODUCT + retval[190] = new Isnontext(); // ISNONTEXT + retval[191] = new Getnote(); // GETNOTE + retval[192] = new Note(); // NOTE + retval[193] = new Stdevp(); // STDEVP + retval[194] = new Varp(); // VARP + retval[195] = new Dstdevp(); // DSTDEVP + retval[196] = new Dvarp(); // DVARP + retval[197] = new Trunc(); // TRUNC + retval[198] = new Islogical(); // ISLOGICAL + retval[199] = new Dcounta(); // DCOUNTA + retval[200] = new Deletebar(); // DELETEBAR + retval[201] = new Unregister(); // UNREGISTER + retval[204] = new Usdollar(); // USDOLLAR + retval[205] = new Findb(); // FINDB + retval[206] = new Searchb(); // SEARCHB + retval[207] = new Replaceb(); // REPLACEB + retval[208] = new Leftb(); // LEFTB + retval[209] = new Rightb(); // RIGHTB + retval[210] = new Midb(); // MIDB + retval[211] = new Lenb(); // LENB + retval[212] = new Roundup(); // ROUNDUP + retval[213] = new Rounddown(); // ROUNDDOWN + retval[214] = new Asc(); // ASC + retval[215] = new Dbcs(); // DBCS + retval[216] = new Rank(); // RANK + retval[219] = new Address(); // ADDRESS + retval[220] = new Days360(); // DAYS360 + retval[221] = new Today(); // TODAY + retval[222] = new Vdb(); // VDB + retval[227] = new Median(); // MEDIAN + retval[228] = new Sumproduct(); // SUMPRODUCT + retval[229] = new Sinh(); // SINH + retval[230] = new Cosh(); // COSH + retval[231] = new Tanh(); // TANH + retval[232] = new Asinh(); // ASINH + retval[233] = new Acosh(); // ACOSH + retval[234] = new Atanh(); // ATANH + retval[235] = new Dget(); // DGET + retval[236] = new Createobject(); // CREATEOBJECT + retval[237] = new Volatile(); // VOLATILE + retval[238] = new Lasterror(); // LASTERROR + retval[239] = new Customundo(); // CUSTOMUNDO + retval[240] = new Customrepeat(); // CUSTOMREPEAT + retval[241] = new Formulaconvert(); // FORMULACONVERT + retval[242] = new Getlinkinfo(); // GETLINKINFO + retval[243] = new Textbox(); // TEXTBOX + retval[244] = new Info(); // INFO + retval[245] = new Group(); // GROUP + retval[246] = new Getobject(); // GETOBJECT + retval[247] = new Db(); // DB + retval[248] = new Pause(); // PAUSE + retval[250] = new Resume(); // RESUME + retval[252] = new Frequency(); // FREQUENCY + retval[253] = new Addtoolbar(); // ADDTOOLBAR + retval[254] = new Deletetoolbar(); // DELETETOOLBAR + retval[255] = new Externalflag(); // EXTERNALFLAG + retval[256] = new Resettoolbar(); // RESETTOOLBAR + retval[257] = new Evaluate(); // EVALUATE + retval[258] = new Gettoolbar(); // GETTOOLBAR + retval[259] = new Gettool(); // GETTOOL + retval[260] = new Spellingcheck(); // SPELLINGCHECK + retval[261] = new Errortype(); // ERRORTYPE + retval[262] = new Apptitle(); // APPTITLE + retval[263] = new Windowtitle(); // WINDOWTITLE + retval[264] = new Savetoolbar(); // SAVETOOLBAR + retval[265] = new Enabletool(); // ENABLETOOL + retval[266] = new Presstool(); // PRESSTOOL + retval[267] = new Registerid(); // REGISTERID + retval[268] = new Getworkbook(); // GETWORKBOOK + retval[269] = new Avedev(); // AVEDEV + retval[270] = new Betadist(); // BETADIST + retval[271] = new Gammaln(); // GAMMALN + retval[272] = new Betainv(); // BETAINV + retval[273] = new Binomdist(); // BINOMDIST + retval[274] = new Chidist(); // CHIDIST + retval[275] = new Chiinv(); // CHIINV + retval[276] = new Combin(); // COMBIN + retval[277] = new Confidence(); // CONFIDENCE + retval[278] = new Critbinom(); // CRITBINOM + retval[279] = new Even(); // EVEN + retval[280] = new Expondist(); // EXPONDIST + retval[281] = new Fdist(); // FDIST + retval[282] = new Finv(); // FINV + retval[283] = new Fisher(); // FISHER + retval[284] = new Fisherinv(); // FISHERINV + retval[285] = new Floor(); // FLOOR + retval[286] = new Gammadist(); // GAMMADIST + retval[287] = new Gammainv(); // GAMMAINV + retval[288] = new Ceiling(); // CEILING + retval[289] = new Hypgeomdist(); // HYPGEOMDIST + retval[290] = new Lognormdist(); // LOGNORMDIST + retval[291] = new Loginv(); // LOGINV + retval[292] = new Negbinomdist(); // NEGBINOMDIST + retval[293] = new Normdist(); // NORMDIST + retval[294] = new Normsdist(); // NORMSDIST + retval[295] = new Norminv(); // NORMINV + retval[296] = new Normsinv(); // NORMSINV + retval[297] = new Standardize(); // STANDARDIZE + retval[298] = new Odd(); // ODD + retval[299] = new Permut(); // PERMUT + retval[300] = new Poisson(); // POISSON + retval[301] = new Tdist(); // TDIST + retval[302] = new Weibull(); // WEIBULL + retval[303] = new Sumxmy2(); // SUMXMY2 + retval[304] = new Sumx2my2(); // SUMX2MY2 + retval[305] = new Sumx2py2(); // SUMX2PY2 + retval[306] = new Chitest(); // CHITEST + retval[307] = new Correl(); // CORREL + retval[308] = new Covar(); // COVAR + retval[309] = new Forecast(); // FORECAST + retval[310] = new Ftest(); // FTEST + retval[311] = new Intercept(); // INTERCEPT + retval[312] = new Pearson(); // PEARSON + retval[313] = new Rsq(); // RSQ + retval[314] = new Steyx(); // STEYX + retval[315] = new Slope(); // SLOPE + retval[316] = new Ttest(); // TTEST + retval[317] = new Prob(); // PROB + retval[318] = new Devsq(); // DEVSQ + retval[319] = new Geomean(); // GEOMEAN + retval[320] = new Harmean(); // HARMEAN + retval[321] = new Sumsq(); // SUMSQ + retval[322] = new Kurt(); // KURT + retval[323] = new Skew(); // SKEW + retval[324] = new Ztest(); // ZTEST + retval[325] = new Large(); // LARGE + retval[326] = new Small(); // SMALL + retval[327] = new Quartile(); // QUARTILE + retval[328] = new Percentile(); // PERCENTILE + retval[329] = new Percentrank(); // PERCENTRANK + retval[330] = new Mode(); // MODE + retval[331] = new Trimmean(); // TRIMMEAN + retval[332] = new Tinv(); // TINV + retval[334] = new Moviecommand(); // MOVIECOMMAND + retval[335] = new Getmovie(); // GETMOVIE + retval[336] = new Concatenate(); // CONCATENATE + retval[337] = new Power(); // POWER + retval[338] = new Pivotadddata(); // PIVOTADDDATA + retval[339] = new Getpivottable(); // GETPIVOTTABLE + retval[340] = new Getpivotfield(); // GETPIVOTFIELD + retval[341] = new Getpivotitem(); // GETPIVOTITEM + retval[342] = new Radians(); // RADIANS + retval[343] = new Degrees(); // DEGREES + retval[344] = new Subtotal(); // SUBTOTAL + retval[345] = new Sumif(); // SUMIF + retval[346] = new Countif(); // COUNTIF + retval[347] = new Countblank(); // COUNTBLANK + retval[348] = new Scenarioget(); // SCENARIOGET + retval[349] = new Optionslistsget(); // OPTIONSLISTSGET + retval[350] = new Ispmt(); // ISPMT + retval[351] = new Datedif(); // DATEDIF + retval[352] = new Datestring(); // DATESTRING + retval[353] = new Numberstring(); // NUMBERSTRING + retval[354] = new Roman(); // ROMAN + retval[355] = new Opendialog(); // OPENDIALOG + retval[356] = new Savedialog(); // SAVEDIALOG + retval[357] = new Viewget(); // VIEWGET + retval[358] = new Getpivotdata(); // GETPIVOTDATA + retval[359] = new Hyperlink(); // HYPERLINK + retval[360] = new Phonetic(); // PHONETIC + retval[361] = new Averagea(); // AVERAGEA + retval[362] = new Maxa(); // MAXA + retval[363] = new Mina(); // MINA + retval[364] = new Stdevpa(); // STDEVPA + retval[365] = new Varpa(); // VARPA + retval[366] = new Stdeva(); // STDEVA + retval[367] = new Vara(); // VARA + return retval; + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterEqualEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterEqualEval.java new file mode 100644 index 0000000000..894a7f01d4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterEqualEval.java @@ -0,0 +1,51 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.GreaterEqualPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class GreaterEqualEval extends RelationalOperationEval { + + private GreaterEqualPtg delegate; + + public GreaterEqualEval(Ptg ptg) { + this.delegate = (GreaterEqualPtg) ptg; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + + RelationalValues rvs = super.doEvaluate(operands, srcRow, srcCol); + retval = rvs.ee; + int result = 0; + if (retval == null) { + result = doComparison(rvs.bs); + if (result == 0) { + result = doComparison(rvs.ss); + } + if (result == 0) { + result = doComparison(rvs.ds); + } + + retval = (result >= 0) ? BoolEval.TRUE : BoolEval.FALSE; + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterThanEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterThanEval.java new file mode 100644 index 0000000000..587c7e6ce5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/GreaterThanEval.java @@ -0,0 +1,51 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.GreaterThanPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class GreaterThanEval extends RelationalOperationEval { + + private GreaterThanPtg delegate; + + public GreaterThanEval(Ptg ptg) { + this.delegate = (GreaterThanPtg) ptg; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + + RelationalValues rvs = super.doEvaluate(operands, srcRow, srcCol); + retval = rvs.ee; + int result = 0; + if (retval == null) { + result = doComparison(rvs.bs); + if (result == 0) { + result = doComparison(rvs.ss); + } + if (result == 0) { + result = doComparison(rvs.ds); + } + + retval = (result > 0) ? BoolEval.TRUE : BoolEval.FALSE;; + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessEqualEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessEqualEval.java new file mode 100644 index 0000000000..3e4000f76c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessEqualEval.java @@ -0,0 +1,51 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.LessEqualPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class LessEqualEval extends RelationalOperationEval { + + private LessEqualPtg delegate; + + public LessEqualEval(Ptg ptg) { + this.delegate = (LessEqualPtg) ptg; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + + RelationalValues rvs = super.doEvaluate(operands, srcRow, srcCol); + retval = rvs.ee; + int result = 0; + if (retval == null) { + result = doComparison(rvs.bs); + if (result == 0) { + result = doComparison(rvs.ss); + } + if (result == 0) { + result = doComparison(rvs.ds); + } + + retval = (result <= 0) ? BoolEval.TRUE : BoolEval.FALSE;; + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessThanEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessThanEval.java new file mode 100644 index 0000000000..5b625e06e2 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/LessThanEval.java @@ -0,0 +1,52 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.LessThanPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class LessThanEval extends RelationalOperationEval { + + private LessThanPtg delegate; + + public LessThanEval(Ptg ptg) { + this.delegate = (LessThanPtg) ptg; + } + + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + + RelationalValues rvs = super.doEvaluate(operands, srcRow, srcCol); + retval = rvs.ee; + int result = 0; + if (retval == null) { + result = doComparison(rvs.bs); + if (result == 0) { + result = doComparison(rvs.ss); + } + if (result == 0) { + result = doComparison(rvs.ds); + } + + retval = (result < 0) ? BoolEval.TRUE : BoolEval.FALSE;; + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/MultiplyEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/MultiplyEval.java new file mode 100644 index 0000000000..e55d53226a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/MultiplyEval.java @@ -0,0 +1,84 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.MultiplyPtg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class MultiplyEval extends NumericOperationEval { + + private MultiplyPtg delegate; + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + public MultiplyEval(Ptg ptg) { + delegate = (MultiplyPtg) ptg; + } + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + Eval retval = null; + double d0 = 0; + double d1 = 0; + switch (operands.length) { + default: // will rarely happen. currently the parser itself fails. + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 2: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d0 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + + if (retval == null) { // no error yet + ve = singleOperandEvaluate(operands[1], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d1 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + } // end switch + + if (retval == null) { + retval = (Double.isNaN(d0) || Double.isNaN(d1)) + ? (ValueEval) ErrorEval.VALUE_INVALID + : new NumberEval(d0 * d1); + } + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NotEqualEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NotEqualEval.java new file mode 100644 index 0000000000..e868864f35 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NotEqualEval.java @@ -0,0 +1,52 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.NotEqualPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class NotEqualEval extends RelationalOperationEval { + + private NotEqualPtg delegate; + + public NotEqualEval(Ptg ptg) { + this.delegate = (NotEqualPtg) ptg; + } + + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + + RelationalValues rvs = super.doEvaluate(operands, srcRow, srcCol); + retval = rvs.ee; + int result = 0; + if (retval == null) { + result = doComparison(rvs.bs); + if (result == 0) { + result = doComparison(rvs.ss); + } + if (result == 0) { + result = doComparison(rvs.ds); + } + + retval = (result != 0) ? BoolEval.TRUE : BoolEval.FALSE; + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumberEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumberEval.java new file mode 100644 index 0000000000..764c59f205 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumberEval.java @@ -0,0 +1,55 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.IntPtg; +import org.apache.poi.hssf.record.formula.NumberPtg; +import org.apache.poi.hssf.record.formula.Ptg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class NumberEval implements NumericValueEval, StringValueEval { + + private double value; + private String stringValue; + + public NumberEval(Ptg ptg) { + if (ptg instanceof IntPtg) { + this.value = ((IntPtg) ptg).getValue(); + } + else if (ptg instanceof NumberPtg) { + this.value = ((NumberPtg) ptg).getValue(); + } + } + + public NumberEval(double value) { + this.value = value; + } + + public double getNumberValue() { + return value; + } + + public String getStringValue() { // TODO: limit to 15 decimal places + if (stringValue == null) + makeString(); + return stringValue; + } + + protected void makeString() { + if (!Double.isNaN(value)) { + long lvalue = Math.round(value); + if (lvalue == value) { + stringValue = String.valueOf(lvalue); + } + else { + stringValue = String.valueOf(value); + } + } + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericOperationEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericOperationEval.java new file mode 100644 index 0000000000..8c40306b78 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericOperationEval.java @@ -0,0 +1,50 @@ +/* + * Created on May 14, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public abstract class NumericOperationEval implements OperationEval { + + protected abstract ValueEvalToNumericXlator getXlator(); + + protected ValueEval singleOperandEvaluate(Eval eval, int srcRow, short srcCol) { + ValueEval retval; + if (eval instanceof AreaEval) { + AreaEval ae = (AreaEval) eval; + if (ae.contains(srcRow, srcCol)) { // circular ref! + retval = ErrorEval.CIRCULAR_REF_ERROR; + } + else if (ae.isRow()) { + if (ae.containsColumn(srcCol)) { + ValueEval ve = ae.getValueAt(ae.getFirstRow(), srcCol); + ve = getXlator().attemptXlateToNumeric(ve); + retval = getXlator().attemptXlateToNumeric(ve); + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else if (ae.isColumn()) { + if (ae.containsRow(srcRow)) { + ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn()); + retval = getXlator().attemptXlateToNumeric(ve); + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else { + retval = getXlator().attemptXlateToNumeric((ValueEval) eval); + } + return retval; + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericValueEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericValueEval.java new file mode 100644 index 0000000000..06ead84f02 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/NumericValueEval.java @@ -0,0 +1,14 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public interface NumericValueEval extends ValueEval { + + public abstract double getNumberValue(); +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/OperationEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/OperationEval.java new file mode 100644 index 0000000000..1472cb5b36 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/OperationEval.java @@ -0,0 +1,37 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public interface OperationEval extends Eval { + + /* + * Read this, this will make your work easier when coding + * an "evaluate()" + * + * Things to note when implementing evaluate(): + * 1. Check the length of operands + * (use "switch(operands[x])" if possible) + * + * 2. The possible Evals that you can get as args to evaluate are one of: + * NumericValueEval, StringValueEval, RefEval, AreaEval + * 3. If it is RefEval, the innerValueEval could be one of: + * NumericValueEval, StringValueEval, BlankEval + * 4. If it is AreaEval, each of the values could be one of: + * NumericValueEval, StringValueEval, BlankEval, RefEval + * + * 5. For numeric functions/operations, keep the result in double + * till the end and before returning a new NumberEval, check to see + * if the double is a NaN - if NaN, return ErrorEval.ERROR_503 + */ + public abstract Eval evaluate(Eval[] evals, int srcCellRow, short srcCellCol); + + public abstract int getNumberOfOperands(); + + public abstract int getType(); +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/PowerEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/PowerEval.java new file mode 100644 index 0000000000..641cf10ae6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/PowerEval.java @@ -0,0 +1,86 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.PowerPtg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class PowerEval extends NumericOperationEval { + + private PowerPtg delegate; + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + public PowerEval(Ptg ptg) { + delegate = (PowerPtg) ptg; + } + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + Eval retval = null; + double d0 = 0; + double d1 = 0; + + switch (operands.length) { + default: // will rarely happen. currently the parser itself fails. + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 2: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d0 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + + if (retval == null) { // no error yet + ve = singleOperandEvaluate(operands[1], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d1 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + } // end switch + + if (retval == null) { + double p = Math.pow(d0, d1); + retval = (Double.isNaN(p)) + ? (ValueEval) ErrorEval.VALUE_INVALID + : new NumberEval(p); + } + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref2DEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref2DEval.java new file mode 100644 index 0000000000..410188f2bd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref2DEval.java @@ -0,0 +1,44 @@ +/* + * Created on May 9, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.ReferencePtg; + +/** + * @author adeshmukh + * + */ +public class Ref2DEval implements RefEval { + + private ValueEval value; + + private ReferencePtg delegate; + + private boolean evaluated; + + public Ref2DEval(Ptg ptg, ValueEval value, boolean evaluated) { + this.value = value; + this.delegate = (ReferencePtg) ptg; + this.evaluated = evaluated; + } + + public ValueEval getInnerValueEval() { + return value; + } + + public short getRow() { + return delegate.getRow(); + } + + public short getColumn() { + return delegate.getColumn(); + } + + public boolean isEvaluated() { + return evaluated; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref3DEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref3DEval.java new file mode 100644 index 0000000000..56df7a7465 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/Ref3DEval.java @@ -0,0 +1,44 @@ +/* + * Created on May 9, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.Ref3DPtg; + +/** + * @author Amol S. Deshmukh + * + */ +public class Ref3DEval implements RefEval { + + private ValueEval value; + + private Ref3DPtg delegate; + + private boolean evaluated; + + public Ref3DEval(Ptg ptg, ValueEval value, boolean evaluated) { + this.value = value; + this.delegate = (Ref3DPtg) ptg; + this.evaluated = evaluated; + } + + public ValueEval getInnerValueEval() { + return value; + } + + public short getRow() { + return delegate.getRow(); + } + + public short getColumn() { + return delegate.getColumn(); + } + + public boolean isEvaluated() { + return evaluated; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RefEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RefEval.java new file mode 100644 index 0000000000..f10a04013f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RefEval.java @@ -0,0 +1,57 @@ +/* + * Created on May 9, 2005 + * + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S Deshmukh < amolweb at ya hoo dot com > + * + * RefEval is the super interface for Ref2D and Ref3DEval. Basically a RefEval + * impl should contain reference to the original ReferencePtg or Ref3DPtg as + * well as the final "value" resulting from the evaluation of the cell + * reference. Thus if the HSSFCell has type CELL_TYPE_NUMERIC, the contained + * value object should be of type NumberEval; if cell type is CELL_TYPE_STRING, + * contained value object should be of type StringEval + */ +public interface RefEval extends ValueEval { + + /** + * The (possibly evaluated) ValueEval contained + * in this RefEval. eg. if cell A1 contains "test" + * then in a formula referring to cell A1 + * the RefEval representing + * A1 will return as the getInnerValueEval() the + * object of concrete type StringEval + * @return + */ + public ValueEval getInnerValueEval(); + + /** + * returns the column index. + * @return + */ + public short getColumn(); + + /** + * returns the row index. + * @return + */ + public short getRow(); + + /** + * returns true if this RefEval contains an + * evaluated value instead of a direct value. + * eg. say cell A1 has the value: ="test" + * Then the RefEval representing A1 will return + * isEvaluated() equal to false. On the other + * hand, say cell A1 has the value: =B1 and + * B1 has the value "test", then the RefEval + * representing A1 will return isEvaluated() + * equal to true. + * @return + */ + public boolean isEvaluated(); + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RelationalOperationEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RelationalOperationEval.java new file mode 100644 index 0000000000..de5004d92d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/RelationalOperationEval.java @@ -0,0 +1,200 @@ +/* + * Created on May 10, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public abstract class RelationalOperationEval implements OperationEval { + + protected class RelationalValues { + public Double[] ds = new Double[2]; + public Boolean[] bs = new Boolean[2]; + public String[] ss = new String[3]; + public ErrorEval ee = null; + } + + + /* + * This is a description of how the relational operators apply in MS Excel. + * Use this as a guideline when testing/implementing the evaluate methods + * for the relational operators Evals. + * + * Bool > any number. ALWAYS + * Bool > any string. ALWAYS + * Bool.TRUE > Bool.FALSE + * + * String > any number. ALWAYS + * String > Blank. ALWAYS + * String are sorted dictionary wise + * + * Blank == 0 (numeric) + */ + public RelationalValues doEvaluate(Eval[] operands, int srcRow, short srcCol) { + RelationalValues retval = new RelationalValues(); + + switch (operands.length) { + default: + retval.ee = ErrorEval.ERROR_520; + break; + case 2: + internalDoEvaluate(operands, srcRow, srcCol, retval, 0); + internalDoEvaluate(operands, srcRow, srcCol, retval, 1); + } // end switch + return retval; + } + + /** + * convenience method to avoid code duplication for multiple operands + * @param operands + * @param srcRow + * @param srcCol + * @param retval + * @param index + */ + private void internalDoEvaluate(Eval[] operands, int srcRow, short srcCol, RelationalValues retval, int index) { + if (operands[index] instanceof BoolEval) { + BoolEval be = (BoolEval) operands[index]; + retval.bs[index] = Boolean.valueOf(be.getBooleanValue()); + } + else if (operands[index] instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) operands[index]; + retval.ds[index] = new Double(ne.getNumberValue()); + } + else if (operands[index] instanceof StringValueEval) { + StringValueEval se = (StringValueEval) operands[index]; + retval.ss[index] = se.getStringValue(); + } + else if (operands[index] instanceof RefEval) { + RefEval re = (RefEval) operands[index]; + ValueEval ve = re.getInnerValueEval(); + if (ve instanceof BoolEval) { + BoolEval be = (BoolEval) ve; + retval.bs[index] = Boolean.valueOf(be.getBooleanValue()); + } + else if (ve instanceof BlankEval) { + retval.ds[index] = new Double(0); + } + else if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + retval.ds[index] = new Double(ne.getNumberValue()); + } + else if (ve instanceof StringValueEval) { + StringValueEval se = (StringValueEval) ve; + retval.ss[index] = se.getStringValue(); + } + } + else if (operands[index] instanceof AreaEval) { + AreaEval ae = (AreaEval) operands[index]; + if (ae.isRow()) { + if (ae.containsColumn(srcCol)) { + ValueEval ve = ae.getValueAt(ae.getFirstRow(), srcCol); + if (ve instanceof BoolEval) { + BoolEval be = (BoolEval) ve; + retval.bs[index] = Boolean.valueOf(be.getBooleanValue()); + } + else if (ve instanceof BlankEval) { + retval.ds[index] = new Double(0); + } + else if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + retval.ds[index] = new Double(ne.getNumberValue()); + } + else if (ve instanceof StringValueEval) { + StringValueEval se = (StringValueEval) ve; + retval.ss[index] = se.getStringValue(); + } + else { + retval.ee = ErrorEval.VALUE_INVALID; + } + } + else { + retval.ee = ErrorEval.VALUE_INVALID; + } + } + else if (ae.isColumn()) { + if (ae.containsRow(srcRow)) { + ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn()); + if (ve instanceof BoolEval) { + BoolEval be = (BoolEval) ve; + retval.bs[index] = Boolean.valueOf(be.getBooleanValue()); + } + else if (ve instanceof BlankEval) { + retval.ds[index] = new Double(0); + } + else if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + retval.ds[index] = new Double(ne.getNumberValue()); + } + else if (ve instanceof StringValueEval) { + StringValueEval se = (StringValueEval) ve; + retval.ss[index] = se.getStringValue(); + } + else { + retval.ee = ErrorEval.VALUE_INVALID; + } + } + else { + retval.ee = ErrorEval.VALUE_INVALID; + } + } + else { + retval.ee = ErrorEval.VALUE_INVALID; + } + } + } + + // if both null return 0, else non null wins, else TRUE wins + protected int doComparison(Boolean[] bs) { + int retval = 0; + if (bs[0] != null || bs[1] != null) { + retval = bs[0] != null + ? bs[1] != null + ? bs[0].booleanValue() + ? bs[1].booleanValue() + ? 0 + : 1 + : bs[1].booleanValue() + ? -1 + : 0 + : 1 + : bs[1] != null + ? -1 + : 0; + } + return retval; + } + + // if both null return 0, else non null wins, else string compare + protected int doComparison(String[] ss) { + int retval = 0; + if (ss[0] != null || ss[1] != null) { + retval = ss[0] != null + ? ss[1] != null + ? ss[0].compareTo(ss[1]) + : 1 + : ss[1] != null + ? -1 + : 0; + } + return retval; + } + + // if both null return 0, else non null wins, else doublevalue compare + protected int doComparison(Double[] ds) { + int retval = 0; + if (ds[0] != null || ds[1] != null) { + retval = ds[0] != null + ? ds[1] != null + ? ds[0].compareTo(ds[1]) + : 1 + : ds[1] != null + ? -1 + : 0; + } + return retval; + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringEval.java new file mode 100644 index 0000000000..f8b4cca00d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringEval.java @@ -0,0 +1,29 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.StringPtg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class StringEval implements StringValueEval { + + private String value; + + public StringEval(Ptg ptg) { + this.value = ((StringPtg) ptg).getValue(); + } + + public StringEval(String value) { + this.value = value; + } + + public String getStringValue() { + return value; + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringOperationEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringOperationEval.java new file mode 100644 index 0000000000..0f60740a01 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringOperationEval.java @@ -0,0 +1,81 @@ +/* + * Created on May 14, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public abstract class StringOperationEval implements OperationEval { + + + + /** + * Returns an instanceof StringValueEval or ErrorEval or BlankEval + * + * @param eval + * @param srcRow + * @param srcCol + * @return + */ + protected ValueEval singleOperandEvaluate(Eval eval, int srcRow, short srcCol) { + ValueEval retval; + if (eval instanceof AreaEval) { + AreaEval ae = (AreaEval) eval; + if (ae.contains(srcRow, srcCol)) { // circular ref! + retval = ErrorEval.CIRCULAR_REF_ERROR; + } + else if (ae.isRow()) { + if (ae.containsColumn(srcCol)) { + ValueEval ve = ae.getValueAt(ae.getFirstRow(), srcCol); + retval = internalResolveEval(eval); + } + else { + retval = ErrorEval.NAME_INVALID; + } + } + else if (ae.isColumn()) { + if (ae.containsRow(srcRow)) { + ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn()); + retval = internalResolveEval(eval); + } + else { + retval = ErrorEval.NAME_INVALID; + } + } + else { + retval = ErrorEval.NAME_INVALID; + } + } + else { + retval = internalResolveEval(eval); + } + return retval; + } + + private ValueEval internalResolveEval(Eval eval) { + ValueEval retval; + if (eval instanceof StringValueEval) { + retval = (StringValueEval) eval; + } + else if (eval instanceof RefEval) { + RefEval re = (RefEval) eval; + ValueEval tve = re.getInnerValueEval(); + if (tve instanceof StringValueEval || tve instanceof BlankEval) { + retval = tve; + } + else { + retval = ErrorEval.NAME_INVALID; + } + } + else if (eval instanceof BlankEval) { + retval = (BlankEval) eval; + } + else { + retval = ErrorEval.NAME_INVALID; + } + return retval; + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringValueEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringValueEval.java new file mode 100644 index 0000000000..9cadd30013 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/StringValueEval.java @@ -0,0 +1,14 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public interface StringValueEval extends ValueEval { + + public String getStringValue(); +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/SubtractEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/SubtractEval.java new file mode 100644 index 0000000000..6b2c9899cf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/SubtractEval.java @@ -0,0 +1,84 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.SubtractPtg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class SubtractEval extends NumericOperationEval { + + private SubtractPtg delegate; + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + public SubtractEval(Ptg ptg) { + delegate = (SubtractPtg) ptg; + } + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + Eval retval = null; + double d0 = 0; + double d1 = 0; + switch (operands.length) { + default: // will rarely happen. currently the parser itself fails. + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 2: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d0 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + + if (retval == null) { // no error yet + ve = singleOperandEvaluate(operands[1], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d1 = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + } // end switch + + if (retval == null) { + retval = (Double.isNaN(d0) || Double.isNaN(d1)) + ? (ValueEval) ErrorEval.VALUE_INVALID + : new NumberEval(d0 - d1); + } + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryMinusEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryMinusEval.java new file mode 100644 index 0000000000..84eececceb --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryMinusEval.java @@ -0,0 +1,71 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.UnaryMinusPtg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class UnaryMinusEval extends NumericOperationEval { + + private UnaryMinusPtg delegate; + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + + public UnaryMinusEval(Ptg ptg) { + this.delegate = (UnaryMinusPtg) ptg; + } + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + double d = 0; + + switch (operands.length) { + default: + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + d = ((NumericValueEval) ve).getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else if (ve instanceof ErrorEval) { + retval = ve; + } + } + + if (retval == null) { + retval = new NumberEval(-d); + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryPlusEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryPlusEval.java new file mode 100644 index 0000000000..5b311661fd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/UnaryPlusEval.java @@ -0,0 +1,131 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.UnaryPlusPtg; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class UnaryPlusEval implements OperationEval /*extends NumericOperationEval*/ { + + private UnaryPlusPtg delegate; + + /* + * COMMENT FOR COMMENTED CODE IN THIS FILE + * + * The loser who programmed this in excel didnt care to + * think about how strings were handled in other numeric + * operations when he/she was implementing this operation :P + * + * Here's what I mean: + * + * Q. If the formula -"hello" evaluates to #VALUE! in excel, what should + * the formula +"hello" evaluate to? + * + * A. +"hello" evaluates to "hello" + * + * DO NOT remove the commented code (In memory of the excel + * programmer who implemented the UnaryPlus operation :) + */ + + +// private static final ValueEvalToNumericXlator NUM_XLATOR = +// new ValueEvalToNumericXlator((short) +// ( ValueEvalToNumericXlator.BOOL_IS_PARSED +// | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED +// | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED +// | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED +// | ValueEvalToNumericXlator.STRING_IS_PARSED +// )); + + + public UnaryPlusEval(Ptg ptg) { + this.delegate = (UnaryPlusPtg) ptg; + } + +// protected ValueEvalToNumericXlator getXlator() { +// return NUM_XLATOR; +// } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + + switch (operands.length) { + default: + retval = ErrorEval.UNKNOWN_ERROR; + break; + case 1: + +// ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); +// if (ve instanceof NumericValueEval) { +// d = ((NumericValueEval) ve).getNumberValue(); +// } +// else if (ve instanceof BlankEval) { +// // do nothing +// } +// else if (ve instanceof ErrorEval) { +// retval = ve; +// } + if (operands[0] instanceof RefEval) { + RefEval re = (RefEval) operands[0]; + retval = re.getInnerValueEval(); + } + else if (operands[0] instanceof AreaEval) { + AreaEval ae = (AreaEval) operands[0]; + if (ae.contains(srcRow, srcCol)) { // circular ref! + retval = ErrorEval.CIRCULAR_REF_ERROR; + } + else if (ae.isRow()) { + if (ae.containsColumn(srcCol)) { + ValueEval ve = ae.getValueAt(ae.getFirstRow(), srcCol); + if (ve instanceof RefEval) { + ve = ((RefEval) ve).getInnerValueEval(); + } + retval = ve; + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else if (ae.isColumn()) { + if (ae.containsRow(srcRow)) { + ValueEval ve = ae.getValueAt(ae.getFirstRow(), srcCol); + if (ve instanceof RefEval) { + ve = ((RefEval) ve).getInnerValueEval(); + } + retval = ve; + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else { + retval = (ValueEval) operands[0]; + } + } + + if (retval instanceof BlankEval) { + retval = new NumberEval(0); + } + + return retval; + } + + public int getNumberOfOperands() { + return delegate.getNumberOfOperands(); + } + + public int getType() { + return delegate.getType(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEval.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEval.java new file mode 100644 index 0000000000..44d0d6de5e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEval.java @@ -0,0 +1,13 @@ +/* + * Created on May 8, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public interface ValueEval extends Eval { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEvalToNumericXlator.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEvalToNumericXlator.java new file mode 100644 index 0000000000..fb089227e5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/eval/ValueEvalToNumericXlator.java @@ -0,0 +1,203 @@ +/* + * Created on May 14, 2005 + * + */ +package org.apache.poi.hssf.record.formula.eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class ValueEvalToNumericXlator { + + public static final short STRING_IS_PARSED = 0x0001; + public static final short BOOL_IS_PARSED = 0x0002; + + public static final short REF_STRING_IS_PARSED = 0x0004; + public static final short REF_BOOL_IS_PARSED = 0x0008; + + public static final short EVALUATED_REF_STRING_IS_PARSED = 0x0010; + public static final short EVALUATED_REF_BOOL_IS_PARSED = 0x0020; + + public static final short STRING_TO_BOOL_IS_PARSED = 0x0040; + public static final short REF_STRING_TO_BOOL_IS_PARSED = 0x0080; + + public static final short STRING_IS_INVALID_VALUE = 0x0100; + public static final short REF_STRING_IS_INVALID_VALUE = 0x200; + + private final short flags; + + + public ValueEvalToNumericXlator(short flags) { + this.flags = flags; + } + + /** + * returned value can be either A NumericValueEval, BlankEval or ErrorEval. + * The params can be either NumberEval, BoolEval, StringEval, or + * RefEval + * @param eval + * @return + */ + public ValueEval attemptXlateToNumeric(ValueEval eval) { + ValueEval retval = null; + + if (eval == null) { + retval = BlankEval.INSTANCE; + } + + // most common case - least worries :) + else if (eval instanceof NumberEval) { + retval = (NumberEval) eval; + } + + // booleval + else if (((flags | BOOL_IS_PARSED) > 0) && eval instanceof BoolEval) { + retval = (NumericValueEval) eval; + } + + // stringeval + else if (eval instanceof StringEval) { + retval = handleStringEval((StringEval) eval); + } + + // refeval + else if (eval instanceof RefEval) { + retval = handleRefEval((RefEval) eval); + } + + //blankeval + else if (eval instanceof BlankEval) { + retval = eval; + } + + // erroreval + else if (eval instanceof ErrorEval) { + retval = eval; + } + + // probably AreaEval? then not acceptable. + else { + throw new RuntimeException("Invalid ValueEval type passed for conversion: " + eval.getClass()); + } + return retval; + } + + /** + * uses the relevant flags to decode the supplied RefVal + * @param eval + * @return + */ + private ValueEval handleRefEval(RefEval reval) { + ValueEval retval = null; + ValueEval eval = (ValueEval) reval.getInnerValueEval(); + + // most common case - least worries :) + if (eval instanceof NumberEval) { + retval = (NumberEval) eval; // the cast is correct :) + } + + // booleval + else if (((flags | REF_BOOL_IS_PARSED) > 0) && eval instanceof BoolEval) { + retval = (NumericValueEval) eval; + } + + // stringeval + else if (eval instanceof StringEval) { + retval = handleRefStringEval((StringEval) eval); + } + + //blankeval + else if (eval instanceof BlankEval) { + retval = eval; + } + + // erroreval + else if (eval instanceof ErrorEval) { + retval = eval; + } + + // probably AreaEval or another RefEval? then not acceptable. + else { + throw new RuntimeException("Invalid ValueEval type passed for conversion: " + eval.getClass()); + } + return retval; + } + + /** + * uses the relevant flags to decode the StringEval + * @param eval + * @return + */ + private ValueEval handleStringEval(StringEval eval) { + ValueEval retval = null; + if ((flags | STRING_IS_PARSED) > 0) { + StringEval sve = (StringEval) eval; + String s = sve.getStringValue(); + try { + double d = Double.parseDouble(s); + retval = new NumberEval(d); + } + catch (Exception e) { retval = ErrorEval.VALUE_INVALID; } + } + else if ((flags | STRING_TO_BOOL_IS_PARSED) > 0) { + StringEval sve = (StringEval) eval; + String s = sve.getStringValue(); + try { + boolean b = Boolean.getBoolean(s); + retval = b ? BoolEval.TRUE : BoolEval.FALSE; + } + catch (Exception e) { retval = ErrorEval.VALUE_INVALID; } + } + + // strings are errors? + else if ((flags | STRING_IS_INVALID_VALUE) > 0) { + retval = ErrorEval.VALUE_INVALID; + } + + // ignore strings + else { + retval = BlankEval.INSTANCE; + } + return retval; + } + + /** + * uses the relevant flags to decode the StringEval + * @param eval + * @return + */ + private ValueEval handleRefStringEval(StringEval eval) { + ValueEval retval = null; + if ((flags | REF_STRING_IS_PARSED) > 0) { + StringEval sve = (StringEval) eval; + String s = sve.getStringValue(); + try { + double d = Double.parseDouble(s); + retval = new NumberEval(d); + } + catch (Exception e) { retval = ErrorEval.VALUE_INVALID; } + } + else if ((flags | REF_STRING_TO_BOOL_IS_PARSED) > 0) { + StringEval sve = (StringEval) eval; + String s = sve.getStringValue(); + try { + boolean b = Boolean.getBoolean(s); + retval = retval = b ? BoolEval.TRUE : BoolEval.FALSE;; + } + catch (Exception e) { retval = ErrorEval.VALUE_INVALID; } + } + + // strings are errors? + else if ((flags | REF_STRING_IS_INVALID_VALUE) > 0) { + retval = ErrorEval.VALUE_INVALID; + } + + // ignore strings + else { + retval = BlankEval.INSTANCE; + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Abs.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Abs.java new file mode 100644 index 0000000000..9f29615ae5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Abs.java @@ -0,0 +1,62 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Abs extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + retval = ErrorEval.VALUE_INVALID; + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(Math.abs(d)); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Absref.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Absref.java new file mode 100644 index 0000000000..875e382563 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Absref.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Absref extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acos.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acos.java new file mode 100644 index 0000000000..eb8e69301a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acos.java @@ -0,0 +1,62 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Acos extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + d = Math.acos(d); + retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acosh.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acosh.java new file mode 100644 index 0000000000..570e109325 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Acosh.java @@ -0,0 +1,60 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * Support for hyperbolic trig functions was added as a part of + * Java distribution only in JDK1.5. This class uses custom + * naive implementation based on formulas at: + * http://www.math2.org/math/trig/hyperbolics.htm + * These formulas seem to agree with excel's implementation. + * + */ +public class Acosh extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + } + + if (retval == null) { + d = Math.log(Math.sqrt(Math.pow(d, 2) - 1) + d); + retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.NUM_ERROR : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Activecell.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Activecell.java new file mode 100644 index 0000000000..d8f08c20a1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Activecell.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Activecell extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addbar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addbar.java new file mode 100644 index 0000000000..70000ef0e7 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addbar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Addbar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addcommand.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addcommand.java new file mode 100644 index 0000000000..deab551ead --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addcommand.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Addcommand extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addmenu.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addmenu.java new file mode 100644 index 0000000000..9027fae5c3 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addmenu.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Addmenu extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Address.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Address.java new file mode 100644 index 0000000000..402a3613ae --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Address.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Address extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addtoolbar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addtoolbar.java new file mode 100644 index 0000000000..1d73339b55 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Addtoolbar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Addtoolbar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/And.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/And.java new file mode 100644 index 0000000000..bca5463905 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/And.java @@ -0,0 +1,73 @@ +/* + * Created on May 9, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.AreaEval; +import org.apache.poi.hssf.record.formula.eval.BoolEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.StringEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; + +/** + * @author + * + */ +public class And extends BooleanFunction { + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + boolean b = true; + boolean atleastOneNonBlank = false; + + /* + * Note: do not abort the loop if b is false, since we could be + * dealing with errorevals later. + */ + outer: + for (int i=0, iSize=operands.length; i + *
  9. Blanks are not either true or false + *
  10. Strings are not either true or false (even strings "true" + * or "TRUE" or "0" etc.) + *
  11. Numbers: 0 is false. Any other number is TRUE. + *
  12. References are evaluated and above rules apply. + *
  13. Areas: Individual cells in area are evaluated and checked to + * see if they are blanks, strings etc. + *
+ */ +public abstract class BooleanFunction implements Function { + + protected ValueEval singleOperandEvaluate(Eval eval, int srcRow, short srcCol, boolean stringsAreBlanks) { + ValueEval retval; + + if (eval instanceof RefEval) { + RefEval re = (RefEval) eval; + ValueEval ve = re.getInnerValueEval(); + retval = internalResolve(ve, true); + } + else { + retval = internalResolve(eval, stringsAreBlanks); + } + + return retval; + } + + private ValueEval internalResolve(Eval ve, boolean stringsAreBlanks) { + ValueEval retval = null; + + // blankeval is returned as is + if (ve instanceof BlankEval) { + retval = BlankEval.INSTANCE; + } + + // stringeval + else if (ve instanceof StringEval) { + retval = stringsAreBlanks ? (ValueEval) BlankEval.INSTANCE : (StringEval) ve; + } + + // bools are bools :) + else if (ve instanceof BoolEval) { + retval = (BoolEval) ve; + } + + // convert numbers to bool + else if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + double d = ne.getNumberValue(); + retval = Double.isNaN(d) + ? (ValueEval) ErrorEval.VALUE_INVALID + : (d != 0) + ? BoolEval.TRUE + : BoolEval.FALSE; + } + + // since refevals + else { + retval = ErrorEval.VALUE_INVALID; + } + + return retval; + + } +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Call.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Call.java new file mode 100644 index 0000000000..ae571b38c1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Call.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Call extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Caller.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Caller.java new file mode 100644 index 0000000000..44511b07c0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Caller.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Caller extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cancelkey.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cancelkey.java new file mode 100644 index 0000000000..e257d847bd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cancelkey.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Cancelkey extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ceiling.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ceiling.java new file mode 100644 index 0000000000..ee73137854 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ceiling.java @@ -0,0 +1,14 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + + +/** + * @author + * + */ +public class Ceiling extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cell.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cell.java new file mode 100644 index 0000000000..a8764cde59 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cell.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Cell extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Char.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Char.java new file mode 100644 index 0000000000..c62d72a819 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Char.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Char extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Checkcommand.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Checkcommand.java new file mode 100644 index 0000000000..72d5d15ef9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Checkcommand.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Checkcommand extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chidist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chidist.java new file mode 100644 index 0000000000..04aa57db3f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chidist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Chidist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chiinv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chiinv.java new file mode 100644 index 0000000000..780700799e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chiinv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Chiinv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chitest.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chitest.java new file mode 100644 index 0000000000..c8a7076113 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Chitest.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Chitest extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Choose.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Choose.java new file mode 100644 index 0000000000..b98d27cf00 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Choose.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Choose extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Clean.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Clean.java new file mode 100644 index 0000000000..021e7ce241 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Clean.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Clean extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Code.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Code.java new file mode 100644 index 0000000000..f6a9be517b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Code.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Code extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Column.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Column.java new file mode 100644 index 0000000000..fa04a3ce0b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Column.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Column extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Columns.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Columns.java new file mode 100644 index 0000000000..5c11ea9af8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Columns.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Columns extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Combin.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Combin.java new file mode 100644 index 0000000000..1360d9a66f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Combin.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Combin extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Concatenate.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Concatenate.java new file mode 100644 index 0000000000..ed920f583c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Concatenate.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Concatenate extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Confidence.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Confidence.java new file mode 100644 index 0000000000..031c030cf9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Confidence.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Confidence extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Correl.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Correl.java new file mode 100644 index 0000000000..3eba752175 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Correl.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Correl extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cos.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cos.java new file mode 100644 index 0000000000..52b2c30612 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cos.java @@ -0,0 +1,62 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Cos extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + d = Math.cos(d); + retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cosh.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cosh.java new file mode 100644 index 0000000000..8956a29067 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Cosh.java @@ -0,0 +1,64 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Cosh extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + double ePowX = Math.pow(E, d); + double ePowNegX = Math.pow(E, -d); + d = (ePowX + ePowNegX) / 2; + retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Count.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Count.java new file mode 100644 index 0000000000..acf93d4d87 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Count.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Count extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Counta.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Counta.java new file mode 100644 index 0000000000..5c510b1c31 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Counta.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Counta extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countblank.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countblank.java new file mode 100644 index 0000000000..ed07a1ef1c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countblank.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Countblank extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countif.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countif.java new file mode 100644 index 0000000000..e965ba6b27 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Countif.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Countif extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Covar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Covar.java new file mode 100644 index 0000000000..679d9c75f8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Covar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Covar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Createobject.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Createobject.java new file mode 100644 index 0000000000..ab44df1c84 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Createobject.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Createobject extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Critbinom.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Critbinom.java new file mode 100644 index 0000000000..aacbf86b23 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Critbinom.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Critbinom extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customrepeat.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customrepeat.java new file mode 100644 index 0000000000..aac4d4d999 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customrepeat.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Customrepeat extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customundo.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customundo.java new file mode 100644 index 0000000000..d6bfc6ad61 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Customundo.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Customundo extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Date.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Date.java new file mode 100644 index 0000000000..e9d2afb7be --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Date.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Date extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datedif.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datedif.java new file mode 100644 index 0000000000..11a4126e83 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datedif.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Datedif extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datestring.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datestring.java new file mode 100644 index 0000000000..e98a7ddfde --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datestring.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Datestring extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datevalue.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datevalue.java new file mode 100644 index 0000000000..aa96ad1aad --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Datevalue.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Datevalue extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Daverage.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Daverage.java new file mode 100644 index 0000000000..00e39b2dd8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Daverage.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Daverage extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Day.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Day.java new file mode 100644 index 0000000000..3ffa252594 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Day.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Day extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Days360.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Days360.java new file mode 100644 index 0000000000..33988bcf90 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Days360.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Days360 extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Db.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Db.java new file mode 100644 index 0000000000..676aa3f086 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Db.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Db extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dbcs.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dbcs.java new file mode 100644 index 0000000000..b4bd560b43 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dbcs.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dbcs extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcount.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcount.java new file mode 100644 index 0000000000..9afa9a5f5a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcount.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dcount extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcounta.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcounta.java new file mode 100644 index 0000000000..b026d2009b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dcounta.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dcounta extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ddb.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ddb.java new file mode 100644 index 0000000000..3364be29be --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ddb.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Ddb extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/DefaultFunctionImpl.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/DefaultFunctionImpl.java new file mode 100644 index 0000000000..2a0ad6d1ee --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/DefaultFunctionImpl.java @@ -0,0 +1,25 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; + +/** + * + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * This is the default implementation of a Function class. + * The default behaviour is to return a non-standard ErrorEval + * "ErrorEval.FUNCTION_NOT_IMPLEMENTED". This error should alert + * the user that the formula contained a function that is not + * yet implemented. + */ +public abstract class DefaultFunctionImpl implements Function { + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + return ErrorEval.FUNCTION_NOT_IMPLEMENTED; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Degrees.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Degrees.java new file mode 100644 index 0000000000..19485af417 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Degrees.java @@ -0,0 +1,63 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Degrees extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + retval = ErrorEval.VALUE_INVALID; + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + d = Math.toDegrees(d); + retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletebar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletebar.java new file mode 100644 index 0000000000..ab535a13e0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletebar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Deletebar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletecommand.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletecommand.java new file mode 100644 index 0000000000..6af3b7e85b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletecommand.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Deletecommand extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletemenu.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletemenu.java new file mode 100644 index 0000000000..4f06c001fd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletemenu.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Deletemenu extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletetoolbar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletetoolbar.java new file mode 100644 index 0000000000..1020138670 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deletetoolbar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Deletetoolbar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deref.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deref.java new file mode 100644 index 0000000000..800678f701 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Deref.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Deref extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Devsq.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Devsq.java new file mode 100644 index 0000000000..74d56b276f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Devsq.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Devsq extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dget.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dget.java new file mode 100644 index 0000000000..67f4d25123 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dget.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dget extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dialogbox.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dialogbox.java new file mode 100644 index 0000000000..e208a595d1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dialogbox.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dialogbox extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Directory.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Directory.java new file mode 100644 index 0000000000..13fd7674bd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Directory.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Directory extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmax.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmax.java new file mode 100644 index 0000000000..93467567f5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmax.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dmax extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmin.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmin.java new file mode 100644 index 0000000000..da95d14ef6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dmin.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dmin extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Documents.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Documents.java new file mode 100644 index 0000000000..dcba8ae4b4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Documents.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Documents extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dollar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dollar.java new file mode 100644 index 0000000000..7fa2fe7956 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dollar.java @@ -0,0 +1,61 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Dollar extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dproduct.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dproduct.java new file mode 100644 index 0000000000..36e49743a8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dproduct.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dproduct extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdev.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdev.java new file mode 100644 index 0000000000..6d79b46463 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdev.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dstdev extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdevp.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdevp.java new file mode 100644 index 0000000000..1f00c9c16f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dstdevp.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dstdevp extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dsum.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dsum.java new file mode 100644 index 0000000000..2dacfbb304 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dsum.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dsum extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvar.java new file mode 100644 index 0000000000..bb20af3f02 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dvar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvarp.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvarp.java new file mode 100644 index 0000000000..4bc46ec5fa --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Dvarp.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Dvarp extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Echo.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Echo.java new file mode 100644 index 0000000000..4589b39bc9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Echo.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Echo extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enablecommand.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enablecommand.java new file mode 100644 index 0000000000..85ef966a3c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enablecommand.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Enablecommand extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enabletool.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enabletool.java new file mode 100644 index 0000000000..d060605c01 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Enabletool.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Enabletool extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Error.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Error.java new file mode 100644 index 0000000000..a645e57315 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Error.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Error extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Errortype.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Errortype.java new file mode 100644 index 0000000000..89635ee623 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Errortype.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Errortype extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Evaluate.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Evaluate.java new file mode 100644 index 0000000000..dea6561a9b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Evaluate.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Evaluate extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Even.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Even.java new file mode 100644 index 0000000000..1d5f2be364 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Even.java @@ -0,0 +1,71 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Even extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + retval = ErrorEval.VALUE_INVALID; + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + if (!Double.isNaN(d) && !Double.isInfinite(d)) { + d = (d==0) + ? 0 + : (((long) (d/2))*2 == d) + ? d + : (d < 0) + ? ((((long) (d/2))<<1)-2) + : ((((long) (d/2))<<1)+2); + } + retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exact.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exact.java new file mode 100644 index 0000000000..e4d1c3ae13 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exact.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Exact extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exec.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exec.java new file mode 100644 index 0000000000..362b903038 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exec.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Exec extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Execute.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Execute.java new file mode 100644 index 0000000000..2f41bc3c58 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Execute.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Execute extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exp.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exp.java new file mode 100644 index 0000000000..01d7979ec0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Exp.java @@ -0,0 +1,62 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Exp extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + d = Math.pow(E, d); + retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Expondist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Expondist.java new file mode 100644 index 0000000000..777136f014 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Expondist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Expondist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Externalflag.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Externalflag.java new file mode 100644 index 0000000000..ee0772b802 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Externalflag.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Externalflag extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fact.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fact.java new file mode 100644 index 0000000000..cb28ed1661 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fact.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fact extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/False.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/False.java new file mode 100644 index 0000000000..3516d4b1f3 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/False.java @@ -0,0 +1,30 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BoolEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class False implements Function { + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval; + switch (operands.length) { + default: + retval = ErrorEval.VALUE_INVALID; + break; + case 0: + retval = BoolEval.FALSE; + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fclose.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fclose.java new file mode 100644 index 0000000000..0f4f83578c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fclose.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fclose extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fdist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fdist.java new file mode 100644 index 0000000000..bdeccf7863 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fdist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fdist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Files.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Files.java new file mode 100644 index 0000000000..332b521394 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Files.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Files extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Find.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Find.java new file mode 100644 index 0000000000..8ff188bae9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Find.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Find extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Findb.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Findb.java new file mode 100644 index 0000000000..f32506b86f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Findb.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Findb extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Finv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Finv.java new file mode 100644 index 0000000000..5d49da797a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Finv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Finv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisher.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisher.java new file mode 100644 index 0000000000..6523d24874 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisher.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fisher extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisherinv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisherinv.java new file mode 100644 index 0000000000..c6160b1b90 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fisherinv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fisherinv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fixed.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fixed.java new file mode 100644 index 0000000000..3c08d5108d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fixed.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fixed extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Floor.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Floor.java new file mode 100644 index 0000000000..17b9671ab4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Floor.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Floor extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fopen.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fopen.java new file mode 100644 index 0000000000..82f393bd25 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fopen.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fopen extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Forecast.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Forecast.java new file mode 100644 index 0000000000..5d091c8ff6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Forecast.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Forecast extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Formulaconvert.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Formulaconvert.java new file mode 100644 index 0000000000..1d6d5d2ec0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Formulaconvert.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Formulaconvert extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fpos.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fpos.java new file mode 100644 index 0000000000..521d204cff --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fpos.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fpos extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fread.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fread.java new file mode 100644 index 0000000000..033aaddf73 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fread.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fread extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Freadln.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Freadln.java new file mode 100644 index 0000000000..039d4ca9c7 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Freadln.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Freadln extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Frequency.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Frequency.java new file mode 100644 index 0000000000..069ae7178c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Frequency.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Frequency extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fsize.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fsize.java new file mode 100644 index 0000000000..684b7cacc5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fsize.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fsize extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ftest.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ftest.java new file mode 100644 index 0000000000..7941cc7aee --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ftest.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Ftest extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Function.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Function.java new file mode 100644 index 0000000000..65a9bfcee0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Function.java @@ -0,0 +1,17 @@ +/* + * Created on May 9, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.Eval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * Function serves as a marker interface. + */ +public interface Function { + + public Eval evaluate(Eval[] evals, int srcCellRow, short srcCellCol); + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fv.java new file mode 100644 index 0000000000..d0ef4ab157 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwrite.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwrite.java new file mode 100644 index 0000000000..54fb1365c8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwrite.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fwrite extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwriteln.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwriteln.java new file mode 100644 index 0000000000..d3d5bd004d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Fwriteln.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Fwriteln extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammadist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammadist.java new file mode 100644 index 0000000000..c5d2fe7467 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammadist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Gammadist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammainv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammainv.java new file mode 100644 index 0000000000..44b229029e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammainv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Gammainv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammaln.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammaln.java new file mode 100644 index 0000000000..985d6a92e9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gammaln.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Gammaln extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Geomean.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Geomean.java new file mode 100644 index 0000000000..7c9353fbc4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Geomean.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Geomean extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getbar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getbar.java new file mode 100644 index 0000000000..f098caf20c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getbar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getbar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getcell.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getcell.java new file mode 100644 index 0000000000..bd4e9f3868 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getcell.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getcell extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getchartitem.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getchartitem.java new file mode 100644 index 0000000000..ec623003a4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getchartitem.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getchartitem extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdef.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdef.java new file mode 100644 index 0000000000..fd3b127f15 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdef.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getdef extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdocument.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdocument.java new file mode 100644 index 0000000000..75a20fdec7 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getdocument.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getdocument extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getformula.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getformula.java new file mode 100644 index 0000000000..e9155f191a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getformula.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getformula extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getlinkinfo.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getlinkinfo.java new file mode 100644 index 0000000000..11882aa01e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getlinkinfo.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getlinkinfo extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getmovie.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getmovie.java new file mode 100644 index 0000000000..68d75780f1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getmovie.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getmovie extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getname.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getname.java new file mode 100644 index 0000000000..44ae9309f0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getname.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getname extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getnote.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getnote.java new file mode 100644 index 0000000000..b3f12ea63e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getnote.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getnote extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getobject.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getobject.java new file mode 100644 index 0000000000..0f00dada7f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getobject.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getobject extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotdata.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotdata.java new file mode 100644 index 0000000000..23203af7f9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotdata.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getpivotdata extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotfield.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotfield.java new file mode 100644 index 0000000000..11da0d1934 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotfield.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getpivotfield extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotitem.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotitem.java new file mode 100644 index 0000000000..833da49af3 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivotitem.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getpivotitem extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivottable.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivottable.java new file mode 100644 index 0000000000..6cd548e00f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getpivottable.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getpivottable extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettool.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettool.java new file mode 100644 index 0000000000..de963b99c7 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettool.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Gettool extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettoolbar.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettoolbar.java new file mode 100644 index 0000000000..0163dc4ae5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Gettoolbar.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Gettoolbar extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getwindow.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getwindow.java new file mode 100644 index 0000000000..3ff4c1d6e5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getwindow.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getwindow extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkbook.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkbook.java new file mode 100644 index 0000000000..b307f88a49 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkbook.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getworkbook extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkspace.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkspace.java new file mode 100644 index 0000000000..73579c3991 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Getworkspace.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Getworkspace extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Goto.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Goto.java new file mode 100644 index 0000000000..f39ff3e925 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Goto.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Goto extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Group.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Group.java new file mode 100644 index 0000000000..f52130af4a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Group.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Group extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Growth.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Growth.java new file mode 100644 index 0000000000..a4426b901b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Growth.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Growth extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Halt.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Halt.java new file mode 100644 index 0000000000..ab2e0a4291 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Halt.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Halt extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Harmean.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Harmean.java new file mode 100644 index 0000000000..a5353aa341 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Harmean.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Harmean extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Help.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Help.java new file mode 100644 index 0000000000..ae95c548a2 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Help.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Help extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hlookup.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hlookup.java new file mode 100644 index 0000000000..31e14e07f8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hlookup.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Hlookup extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hour.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hour.java new file mode 100644 index 0000000000..1bd37541f6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hour.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Hour extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hyperlink.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hyperlink.java new file mode 100644 index 0000000000..ff9f6b0f2d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hyperlink.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Hyperlink extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hypgeomdist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hypgeomdist.java new file mode 100644 index 0000000000..f5fb433ed8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Hypgeomdist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Hypgeomdist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Index.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Index.java new file mode 100644 index 0000000000..9de10bd164 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Index.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Index extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Indirect.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Indirect.java new file mode 100644 index 0000000000..98766ae635 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Indirect.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Indirect extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Info.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Info.java new file mode 100644 index 0000000000..7fde4909af --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Info.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Info extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Initiate.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Initiate.java new file mode 100644 index 0000000000..a652ffb3ff --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Initiate.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Initiate extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Input.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Input.java new file mode 100644 index 0000000000..aa089abb9c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Input.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Input extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Int.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Int.java new file mode 100644 index 0000000000..fb60fc0294 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Int.java @@ -0,0 +1,64 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Int extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + if (d < 0) { + d = Math.round(d-0.5); + } + retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval((long) d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Intercept.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Intercept.java new file mode 100644 index 0000000000..ca3eaedf3b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Intercept.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Intercept extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ipmt.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ipmt.java new file mode 100644 index 0000000000..b18605ced6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ipmt.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Ipmt extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Irr.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Irr.java new file mode 100644 index 0000000000..8fba79a2a4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Irr.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Irr extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsError.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsError.java new file mode 100644 index 0000000000..e3d24e088a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsError.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class IsError extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsNa.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsNa.java new file mode 100644 index 0000000000..91185e6797 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/IsNa.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class IsNa extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isblank.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isblank.java new file mode 100644 index 0000000000..7d47905a15 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isblank.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Isblank extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Iserr.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Iserr.java new file mode 100644 index 0000000000..30777ec8e6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Iserr.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Iserr extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Islogical.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Islogical.java new file mode 100644 index 0000000000..2e0f53f70d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Islogical.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Islogical extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnontext.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnontext.java new file mode 100644 index 0000000000..718b9c1aea --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnontext.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Isnontext extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnumber.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnumber.java new file mode 100644 index 0000000000..a9bd8b0602 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isnumber.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Isnumber extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ispmt.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ispmt.java new file mode 100644 index 0000000000..f47cd73ffa --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ispmt.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Ispmt extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isref.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isref.java new file mode 100644 index 0000000000..8ca8a86063 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Isref.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Isref extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Istext.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Istext.java new file mode 100644 index 0000000000..f8471399f9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Istext.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Istext extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Kurt.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Kurt.java new file mode 100644 index 0000000000..0f1771d405 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Kurt.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Kurt extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Large.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Large.java new file mode 100644 index 0000000000..79c9e3caa8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Large.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Large extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lasterror.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lasterror.java new file mode 100644 index 0000000000..6409fea4be --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lasterror.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Lasterror extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Left.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Left.java new file mode 100644 index 0000000000..6495d1cdad --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Left.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Left extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Leftb.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Leftb.java new file mode 100644 index 0000000000..c85327c35b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Leftb.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Leftb extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Len.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Len.java new file mode 100644 index 0000000000..a9ac39874b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Len.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Len extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lenb.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lenb.java new file mode 100644 index 0000000000..643889eb3d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lenb.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Lenb extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Linest.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Linest.java new file mode 100644 index 0000000000..4344774e02 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Linest.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Linest extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Links.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Links.java new file mode 100644 index 0000000000..14088fae0f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Links.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Links extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ln.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ln.java new file mode 100644 index 0000000000..5e80259b9a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Ln.java @@ -0,0 +1,62 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Ln extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + d = Math.log(d); + retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log.java new file mode 100644 index 0000000000..044557b351 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log.java @@ -0,0 +1,83 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * Log: LOG(number,[base]) + */ +public class Log extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + private static final double DEFAULT_BASE = 10; + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + double base = DEFAULT_BASE; + double num = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 2: // second arg is base + ValueEval ve = singleOperandEvaluate(operands[1], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + base = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + + case 1: // first arg is number + if (retval == null) { + ValueEval vev = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (vev instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) vev; + num = ne.getNumberValue(); + } + else if (vev instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + } + + if (retval == null) { + d = (base == E) + ? Math.log(num) + : Math.log(num) / Math.log(base); + retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log10.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log10.java new file mode 100644 index 0000000000..ee8261cd54 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Log10.java @@ -0,0 +1,64 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Log10 extends NumericFunction { + private static final double LOG_10_TO_BASE_e = Math.log(10); + + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + d = Math.log(d) / LOG_10_TO_BASE_e; + retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Logest.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Logest.java new file mode 100644 index 0000000000..ea60625180 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Logest.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Logest extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Loginv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Loginv.java new file mode 100644 index 0000000000..02664523e8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Loginv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Loginv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lognormdist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lognormdist.java new file mode 100644 index 0000000000..ff2fc8c2d0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lognormdist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Lognormdist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lookup.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lookup.java new file mode 100644 index 0000000000..fbb0bcef80 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lookup.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Lookup extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lower.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lower.java new file mode 100644 index 0000000000..e5b6f9dc6c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Lower.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Lower extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Match.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Match.java new file mode 100644 index 0000000000..a3a6f1fcad --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Match.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Match extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Max.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Max.java new file mode 100644 index 0000000000..521bc15b4e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Max.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Max extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Maxa.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Maxa.java new file mode 100644 index 0000000000..b9605ac3b6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Maxa.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Maxa extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mdeterm.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mdeterm.java new file mode 100644 index 0000000000..005a50fdbd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mdeterm.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Mdeterm extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Median.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Median.java new file mode 100644 index 0000000000..917819ca0a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Median.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Median extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mid.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mid.java new file mode 100644 index 0000000000..71b7fcba3f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mid.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Mid extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Midb.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Midb.java new file mode 100644 index 0000000000..e538b7c71c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Midb.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Midb extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Min.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Min.java new file mode 100644 index 0000000000..ee3355f7be --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Min.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Min extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mina.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mina.java new file mode 100644 index 0000000000..e75ab4d147 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mina.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Mina extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minute.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minute.java new file mode 100644 index 0000000000..10e2a48845 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minute.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Minute extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minverse.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minverse.java new file mode 100644 index 0000000000..234c567ab2 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Minverse.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Minverse extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mirr.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mirr.java new file mode 100644 index 0000000000..47655bba64 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mirr.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Mirr extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mmult.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mmult.java new file mode 100644 index 0000000000..095baac8d4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mmult.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Mmult extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mod.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mod.java new file mode 100644 index 0000000000..696dabba49 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mod.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Mod extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mode.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mode.java new file mode 100644 index 0000000000..c2e3b388bd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Mode.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Mode extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Month.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Month.java new file mode 100644 index 0000000000..1cfda6394d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Month.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Month extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Moviecommand.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Moviecommand.java new file mode 100644 index 0000000000..d1c7db3208 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Moviecommand.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Moviecommand extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/N.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/N.java new file mode 100644 index 0000000000..ccc3b6a731 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/N.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class N extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Na.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Na.java new file mode 100644 index 0000000000..e5a41eb5e4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Na.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Na extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Names.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Names.java new file mode 100644 index 0000000000..1592d043fe --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Names.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Names extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Negbinomdist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Negbinomdist.java new file mode 100644 index 0000000000..bfd08a6083 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Negbinomdist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Negbinomdist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normdist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normdist.java new file mode 100644 index 0000000000..ceac7221a9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normdist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Normdist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Norminv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Norminv.java new file mode 100644 index 0000000000..e0b57041a5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Norminv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Norminv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsdist.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsdist.java new file mode 100644 index 0000000000..ad47b4775f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsdist.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Normsdist extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsinv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsinv.java new file mode 100644 index 0000000000..96fa37a3af --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Normsinv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Normsinv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Not.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Not.java new file mode 100644 index 0000000000..65893f5fba --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Not.java @@ -0,0 +1,14 @@ +/* + * Created on May 9, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + + +/** + * @author + * + */ +public class Not extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Note.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Note.java new file mode 100644 index 0000000000..31f0ec7bc1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Note.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Note extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Now.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Now.java new file mode 100644 index 0000000000..427656a800 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Now.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Now extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Nper.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Nper.java new file mode 100644 index 0000000000..709e493c08 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Nper.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Nper extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Npv.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Npv.java new file mode 100644 index 0000000000..7d86a30bcf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Npv.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Npv extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Numberstring.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Numberstring.java new file mode 100644 index 0000000000..3248cef961 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Numberstring.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Numberstring extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/NumericFunction.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/NumericFunction.java new file mode 100644 index 0000000000..24c4415b12 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/NumericFunction.java @@ -0,0 +1,60 @@ +/* + * Created on May 14, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.AreaEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public abstract class NumericFunction implements Function { + + protected static final double E = Math.E; + protected static final double PI = Math.PI; + + protected abstract ValueEvalToNumericXlator getXlator(); + + protected ValueEval singleOperandEvaluate(Eval eval, int srcRow, short srcCol) { + ValueEval retval; + if (eval instanceof AreaEval) { + AreaEval ae = (AreaEval) eval; + if (ae.contains(srcRow, srcCol)) { // circular ref! + retval = ErrorEval.CIRCULAR_REF_ERROR; + } + else if (ae.isRow()) { + if (ae.containsColumn(srcCol)) { + ValueEval ve = ae.getValueAt(ae.getFirstRow(), srcCol); + ve = getXlator().attemptXlateToNumeric(ve); + retval = getXlator().attemptXlateToNumeric(ve); + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else if (ae.isColumn()) { + if (ae.containsRow(srcRow)) { + ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn()); + retval = getXlator().attemptXlateToNumeric(ve); + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else { + retval = ErrorEval.VALUE_INVALID; + } + } + else { + retval = getXlator().attemptXlateToNumeric((ValueEval) eval); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Odd.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Odd.java new file mode 100644 index 0000000000..3e35d4c2a9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Odd.java @@ -0,0 +1,71 @@ +/* + * Created on May 6, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.BlankEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.NumberEval; +import org.apache.poi.hssf.record.formula.eval.NumericValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; +import org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public class Odd extends NumericFunction { + + private static final ValueEvalToNumericXlator NUM_XLATOR = + new ValueEvalToNumericXlator((short) + ( ValueEvalToNumericXlator.BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.EVALUATED_REF_STRING_IS_PARSED + | ValueEvalToNumericXlator.REF_BOOL_IS_PARSED + | ValueEvalToNumericXlator.STRING_IS_PARSED + )); + + protected ValueEvalToNumericXlator getXlator() { + return NUM_XLATOR; + } + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + double d = 0; + ValueEval retval = null; + + switch (operands.length) { + default: + retval = ErrorEval.VALUE_INVALID; + break; + case 1: + ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol); + if (ve instanceof NumericValueEval) { + NumericValueEval ne = (NumericValueEval) ve; + d = ne.getNumberValue(); + } + else if (ve instanceof BlankEval) { + // do nothing + } + else { + retval = ErrorEval.NUM_ERROR; + } + } + + if (retval == null) { + if (!Double.isNaN(d) && !Double.isInfinite(d)) { + d = (d==0) + ? 1 + : ((((long) d) - 1) % 2 == 0) + ? d + : (d < 0) + ? ((((long) (d/2))<<1)-1) + : ((((long) (d/2))<<1)+1); + } + retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d); + } + return retval; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Offset.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Offset.java new file mode 100644 index 0000000000..ca84761be6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Offset.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Offset extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Opendialog.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Opendialog.java new file mode 100644 index 0000000000..aec9b1a9dc --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Opendialog.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Opendialog extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Optionslistsget.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Optionslistsget.java new file mode 100644 index 0000000000..cbc57667fd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Optionslistsget.java @@ -0,0 +1,13 @@ +/* + * Created on May 15, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +/** + * @author + * + */ +public class Optionslistsget extends DefaultFunctionImpl { + +} diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Or.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Or.java new file mode 100644 index 0000000000..731ed9b91d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/Or.java @@ -0,0 +1,69 @@ +/* + * Created on May 9, 2005 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.AreaEval; +import org.apache.poi.hssf.record.formula.eval.BoolEval; +import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.hssf.record.formula.eval.Eval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; + +/** + * @author + * + */ +public class Or extends BooleanFunction { + + public Eval evaluate(Eval[] operands, int srcRow, short srcCol) { + ValueEval retval = null; + boolean b = false; + boolean atleastOneNonBlank = false; + + /* + * Note: do not abort the loop if b is true, since we could be + * dealing with errorevals later. + */ + outer: + for (int i=0, iSize=operands.length; i + * int evaluatedCellType = evaluator.evaluateInCell(cell).getCellType(); + * + * @param cell + */ + public HSSFCell evaluateInCell(HSSFCell cell) { + if (cell != null) { + switch (cell.getCellType()) { + case HSSFCell.CELL_TYPE_FORMULA: + CellValue cv = getCellValueForEval(internalEvaluate(cell, row, sheet, workbook)); + switch (cv.getCellType()) { + case HSSFCell.CELL_TYPE_BOOLEAN: + cell.setCellValue(cv.getBooleanValue()); + break; + case HSSFCell.CELL_TYPE_ERROR: + cell.setCellValue(cv.getErrorValue()); + break; + case HSSFCell.CELL_TYPE_NUMERIC: + cell.setCellValue(cv.getNumberValue()); + break; + case HSSFCell.CELL_TYPE_STRING: + cell.setCellValue(cv.getStringValue()); + break; + case HSSFCell.CELL_TYPE_BLANK: + break; + case HSSFCell.CELL_TYPE_FORMULA: // this will never happen, we have already evaluated the formula + break; + } + } + } + return cell; + } + + + /** + * Returns a CellValue wrapper around the supplied ValueEval instance. + * @param eval + * @return + */ + protected static CellValue getCellValueForEval(ValueEval eval) { + CellValue retval = null; + if (eval != null) { + if (eval instanceof NumberEval) { + NumberEval ne = (NumberEval) eval; + retval = new CellValue(HSSFCell.CELL_TYPE_NUMERIC); + retval.setNumberValue(ne.getNumberValue()); + } + else if (eval instanceof BoolEval) { + BoolEval be = (BoolEval) eval; + retval = new CellValue(HSSFCell.CELL_TYPE_BOOLEAN); + retval.setBooleanValue(be.getBooleanValue()); + } + else if (eval instanceof StringEval) { + StringEval ne = (StringEval) eval; + retval = new CellValue(HSSFCell.CELL_TYPE_STRING); + retval.setStringValue(ne.getStringValue()); + } + else if (eval instanceof BlankEval) { + retval = new CellValue(HSSFCell.CELL_TYPE_BLANK); + } + else { + retval = new CellValue(HSSFCell.CELL_TYPE_ERROR); + } + } + return retval; + } + + /** + * Dev. Note: Internal evaluate must be passed only a formula cell + * else a runtime exception will be thrown somewhere inside the method. + * (Hence this is a private method.) + * + * @param formula + * @param sheet + * @param workbook + * @return + */ + protected static ValueEval internalEvaluate(HSSFCell srcCell, HSSFRow srcRow, HSSFSheet sheet, HSSFWorkbook workbook) { + int srcRowNum = srcRow.getRowNum(); + short srcColNum = srcCell.getCellNum(); + + FormulaParser parser = new FormulaParser(srcCell.getCellFormula(), workbook.getWorkbook()); + parser.parse(); + Ptg[] ptgs = parser.getRPNPtg(); + // -- parsing over -- + + + Stack stack = new Stack(); + for (int i = 0, iSize = ptgs.length; i < iSize; i++) { + + // since we dont know how to handle these yet :( + if (ptgs[i] instanceof ControlPtg) { continue; } + if (ptgs[i] instanceof MemErrPtg) { continue; } + if (ptgs[i] instanceof MissingArgPtg) { continue; } + if (ptgs[i] instanceof NamePtg) { continue; } + if (ptgs[i] instanceof NameXPtg) { continue; } + if (ptgs[i] instanceof UnknownPtg) { continue; } + + if (ptgs[i] instanceof OperationPtg) { + OperationPtg optg = (OperationPtg) ptgs[i]; + + // parens can be ignored since we have RPN tokens + if (optg instanceof ParenthesisPtg) { continue; } + if (optg instanceof AttrPtg) { continue; } + if (optg instanceof UnionPtg) { continue; } + + OperationEval operation = (OperationEval) getOperationEvalForPtg(optg); + + int numops = operation.getNumberOfOperands(); + Eval[] ops = new Eval[numops]; + + // storing the ops in reverse order since they are popping + for (int j = numops - 1; j >= 0; j--) { + Eval p = (Eval) stack.pop(); + if (p instanceof ErrorEval) { // fast fail + return (ErrorEval) p; + } + ops[j] = p; + } + Eval opresult = operation.evaluate(ops, srcRowNum, srcColNum); + stack.push(opresult); + } + else if (ptgs[i] instanceof ReferencePtg) { + ReferencePtg ptg = (ReferencePtg) ptgs[i]; + short colnum = ptg.getColumn(); + short rownum = ptg.getRow(); + HSSFRow row = sheet.getRow(rownum); + HSSFCell cell = (row != null) ? row.getCell(colnum) : null; + pushRef2DEval(ptg, stack, cell, row, sheet, workbook); + } + else if (ptgs[i] instanceof Ref3DPtg) { + Ref3DPtg ptg = (Ref3DPtg) ptgs[i]; + short colnum = ptg.getColumn(); + short rownum = ptg.getRow(); + HSSFSheet xsheet = workbook.getSheetAt(ptg.getExternSheetIndex()); + HSSFRow row = sheet.getRow(rownum); + HSSFCell cell = (row != null) ? row.getCell(colnum) : null; + pushRef3DEval(ptg, stack, cell, row, sheet, workbook); + } + else if (ptgs[i] instanceof AreaPtg) { + AreaPtg ap = (AreaPtg) ptgs[i]; + short row0 = ap.getFirstRow(); + short col0 = ap.getFirstColumn(); + short row1 = ap.getLastRow(); + short col1 = ap.getLastColumn(); + ValueEval[] values = new ValueEval[(row1 - row0 + 1) * (col1 - col0 + 1)]; + for (short x = row0; sheet != null && x < row1 + 1; x++) { + HSSFRow row = sheet.getRow(x); + for (short y = col0; row != null && y < col1 + 1; y++) { + values[(x - row0) * (col1 - col0 + 1) + (y - col0)] = + getEvalForCell(row.getCell(y), row, sheet, workbook); + } + } + AreaEval ae = new Area2DEval(ap, values); + stack.push(ae); + } + else if (ptgs[i] instanceof Area3DPtg) { + Area3DPtg a3dp = (Area3DPtg) ptgs[i]; + short row0 = a3dp.getFirstRow(); + short col0 = a3dp.getFirstColumn(); + short row1 = a3dp.getLastRow(); + short col1 = a3dp.getLastColumn(); + HSSFSheet xsheet = workbook.getSheetAt(a3dp.getExternSheetIndex()); + ValueEval[] values = new ValueEval[(row1 - row0 + 1) * (col1 - col0 + 1)]; + for (short x = row0; sheet != null && x < row1 + 1; x++) { + HSSFRow row = sheet.getRow(x); + for (short y = col0; row != null && y < col1 + 1; y++) { + values[(x - row0) * (col1 - col0 + 1) + (y - col0)] = + getEvalForCell(row.getCell(y), row, sheet, workbook); + } + } + AreaEval ae = new Area3DEval(a3dp, values); + stack.push(ae); + } + else { + Eval ptgEval = getEvalForPtg(ptgs[i]); + stack.push(ptgEval); + } + } + ValueEval value = ((ValueEval) stack.pop()); + if (value instanceof RefEval) { + RefEval rv = (RefEval) value; + value = rv.getInnerValueEval(); + } + else if (value instanceof AreaEval) { + AreaEval ae = (AreaEval) value; + if (ae.isRow()) + value = ae.getValueAt(ae.getFirstRow(), srcColNum); + else if (ae.isColumn()) + value = ae.getValueAt(srcRowNum, ae.getFirstColumn()); + else + value = ErrorEval.VALUE_INVALID; + } + return value; + } + + /** + * returns the OperationEval concrete impl instance corresponding + * to the suplied operationPtg + * @param ptg + * @return + */ + protected static Eval getOperationEvalForPtg(OperationPtg ptg) { + Eval retval = null; + + Class clazz = (Class) OPERATION_EVALS_MAP.get(ptg.getClass()); + try { + Constructor constructor = clazz.getConstructor(OPERATION_CONSTRUCTOR_CLASS_ARRAY); + retval = (OperationEval) constructor.newInstance(new Ptg[] { ptg }); + } + catch (Exception e) { + throw new RuntimeException("Fatal Error: ", e); + } + return retval; + } + + /** + * returns an appropriate Eval impl instance for the Ptg. The Ptg must be + * one of: Area3DPtg, AreaPtg, ReferencePtg, Ref3DPtg, IntPtg, NumberPtg, + * StringPtg, BoolPtg
special Note: OperationPtg subtypes cannot be + * passed here! + * + * @param ptg + * @return + */ + protected static Eval getEvalForPtg(Ptg ptg) { + Eval retval = null; + + Class clazz = (Class) VALUE_EVALS_MAP.get(ptg.getClass()); + try { + if (ptg instanceof Area3DPtg) { + Constructor constructor = clazz.getConstructor(AREA3D_CONSTRUCTOR_CLASS_ARRAY); + retval = (OperationEval) constructor.newInstance(new Ptg[] { ptg }); + } + else if (ptg instanceof AreaPtg) { + Constructor constructor = clazz.getConstructor(AREA3D_CONSTRUCTOR_CLASS_ARRAY); + retval = (OperationEval) constructor.newInstance(new Ptg[] { ptg }); + } + else if (ptg instanceof ReferencePtg) { + Constructor constructor = clazz.getConstructor(REFERENCE_CONSTRUCTOR_CLASS_ARRAY); + retval = (OperationEval) constructor.newInstance(new Ptg[] { ptg }); + } + else if (ptg instanceof Ref3DPtg) { + Constructor constructor = clazz.getConstructor(REF3D_CONSTRUCTOR_CLASS_ARRAY); + retval = (OperationEval) constructor.newInstance(new Ptg[] { ptg }); + } + else { + if (ptg instanceof IntPtg || ptg instanceof NumberPtg || ptg instanceof StringPtg + || ptg instanceof BoolPtg) { + Constructor constructor = clazz.getConstructor(VALUE_CONTRUCTOR_CLASS_ARRAY); + retval = (ValueEval) constructor.newInstance(new Ptg[] { ptg }); + } + } + } + catch (Exception e) { + throw new RuntimeException("Fatal Error: ", e); + } + return retval; + + } + + /** + * Given a cell, find its type and from that create an appropriate ValueEval + * impl instance and return that. Since the cell could be an external + * reference, we need the sheet that this belongs to. + * Non existent cells are treated as empty. + * @param cell + * @param sheet + * @param workbook + * @return + */ + protected static ValueEval getEvalForCell(HSSFCell cell, HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) { + ValueEval retval = BlankEval.INSTANCE; + if (cell != null) { + switch (cell.getCellType()) { + case HSSFCell.CELL_TYPE_NUMERIC: + retval = new NumberEval(cell.getNumericCellValue()); + break; + case HSSFCell.CELL_TYPE_STRING: + retval = new StringEval(cell.getStringCellValue()); + break; + case HSSFCell.CELL_TYPE_FORMULA: + retval = (ValueEval) internalEvaluate(cell, row, sheet, workbook); + break; + case HSSFCell.CELL_TYPE_BOOLEAN: + retval = cell.getBooleanCellValue() ? BoolEval.TRUE : BoolEval.FALSE; + break; + case HSSFCell.CELL_TYPE_BLANK: + retval = BlankEval.INSTANCE; + break; + case HSSFCell.CELL_TYPE_ERROR: + retval = ErrorEval.UNKNOWN_ERROR; // TODO: think about this... + break; + } + } + return retval; + } + + /** + * create a Ref2DEval for ReferencePtg and push it on the stack. + * Non existent cells are treated as RefEvals containing BlankEval. + * @param ptg + * @param stack + * @param cell + * @param sheet + * @param workbook + */ + protected static void pushRef2DEval(ReferencePtg ptg, Stack stack, + HSSFCell cell, HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) { + if (cell != null) + switch (cell.getCellType()) { + case HSSFCell.CELL_TYPE_NUMERIC: + stack.push(new Ref2DEval(ptg, new NumberEval(cell.getNumericCellValue()), false)); + break; + case HSSFCell.CELL_TYPE_STRING: + stack.push(new Ref2DEval(ptg, new StringEval(cell.getStringCellValue()), false)); + break; + case HSSFCell.CELL_TYPE_FORMULA: + stack.push(new Ref2DEval(ptg, internalEvaluate(cell, row, sheet, workbook), true)); + break; + case HSSFCell.CELL_TYPE_BOOLEAN: + stack.push(new Ref2DEval(ptg, cell.getBooleanCellValue() ? BoolEval.TRUE : BoolEval.FALSE, false)); + break; + case HSSFCell.CELL_TYPE_BLANK: + stack.push(new Ref2DEval(ptg, BlankEval.INSTANCE, false)); + break; + case HSSFCell.CELL_TYPE_ERROR: + stack.push(new Ref2DEval(ptg, ErrorEval.UNKNOWN_ERROR, false)); // TODO: think abt this + break; + } + else { + stack.push(new Ref2DEval(ptg, BlankEval.INSTANCE, false)); + } + } + + /** + * create a Ref3DEval for Ref3DPtg and push it on the stack. + * + * @param ptg + * @param stack + * @param cell + * @param sheet + * @param workbook + */ + protected static void pushRef3DEval(Ref3DPtg ptg, Stack stack, HSSFCell cell, + HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) { + if (cell != null) + switch (cell.getCellType()) { + case HSSFCell.CELL_TYPE_NUMERIC: + stack.push(new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()), false)); + break; + case HSSFCell.CELL_TYPE_STRING: + stack.push(new Ref3DEval(ptg, new StringEval(cell.getStringCellValue()), false)); + break; + case HSSFCell.CELL_TYPE_FORMULA: + stack.push(new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook), true)); + break; + case HSSFCell.CELL_TYPE_BOOLEAN: + stack.push(new Ref3DEval(ptg, cell.getBooleanCellValue() ? BoolEval.TRUE : BoolEval.FALSE, false)); + break; + case HSSFCell.CELL_TYPE_BLANK: + stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false)); + break; + case HSSFCell.CELL_TYPE_ERROR: + stack.push(new Ref3DEval(ptg, ErrorEval.UNKNOWN_ERROR, false)); // TODO: think abt this + break; + } + else { + stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false)); + } + } + + /** + * Mimics the 'data view' of a cell. This allows formula evaluator + * to return a CellValue instead of precasting the value to String + * or Number or boolean type. + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + */ + public static final class CellValue { + private int cellType; + private String stringValue; + private double numberValue; + private boolean booleanValue; + private byte errorValue; + + /** + * CellType should be one of the types defined in HSSFCell + * @param cellType + */ + public CellValue(int cellType) { + super(); + this.cellType = cellType; + } + /** + * @return Returns the booleanValue. + */ + public boolean getBooleanValue() { + return booleanValue; + } + /** + * @param booleanValue The booleanValue to set. + */ + public void setBooleanValue(boolean booleanValue) { + this.booleanValue = booleanValue; + } + /** + * @return Returns the numberValue. + */ + public double getNumberValue() { + return numberValue; + } + /** + * @param numberValue The numberValue to set. + */ + public void setNumberValue(double numberValue) { + this.numberValue = numberValue; + } + /** + * @return Returns the stringValue. + */ + public String getStringValue() { + return stringValue; + } + /** + * @param stringValue The stringValue to set. + */ + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + /** + * @return Returns the cellType. + */ + public int getCellType() { + return cellType; + } + /** + * @return Returns the errorValue. + */ + public byte getErrorValue() { + return errorValue; + } + /** + * @param errorValue The errorValue to set. + */ + public void setErrorValue(byte errorValue) { + this.errorValue = errorValue; + } + } + + /** + * Manual testing... needs "the" c:/temp/test1.xls file to be present. + * + * @param args + * @throws Exception + */ + public static void main(String[] args) throws Exception { + String FILE_NAME = "c:/temp/test1.xls"; + + FileInputStream fis = new FileInputStream(FILE_NAME); + HSSFWorkbook wb = new HSSFWorkbook(fis); + fis.close(); + HSSFSheet sheet = wb.getSheetAt(0); + HSSFFormulaEvaluator instance = new HSSFFormulaEvaluator(sheet, wb); + + for (int rn = 1, rnSize = 4; rn <= rnSize; rn++) { + HSSFRow row = sheet.getRow(rn); + for (int cn = 5, cnSize = 7; cn <= cnSize; cn++) { + HSSFCell cell = row.getCell((short) cn); + System.out.println(new CellReference(rn, cn).toString() + ": " + instance.evaluate(cell)); + } + } + } + + /** + * debug method + * + * @param formula + * @param sheet + * @param workbook + */ + void inspectPtgs(String formula) { + FormulaParser fp = new FormulaParser(formula, workbook.getWorkbook()); + fp.parse(); + Ptg[] ptgs = fp.getRPNPtg(); + System.out.println(""); + for (int i = 0, iSize = ptgs.length; i < iSize; i++) { + System.out.println(""); + System.out.println(ptgs[i]); + if (ptgs[i] instanceof OperationPtg) { + System.out.println("numoperands: " + ((OperationPtg) ptgs[i]).getNumberOfOperands()); + } + System.out.println(""); + } + System.out.println(""); + } + +} diff --git a/src/scratchpad/testcases/org/apache/poi/hssf/data/FormulaEvalTestData.xls b/src/scratchpad/testcases/org/apache/poi/hssf/data/FormulaEvalTestData.xls new file mode 100644 index 0000000000000000000000000000000000000000..e7921e3d11049f43db96fc68ad976b539ed62d33 GIT binary patch literal 92160 zcmeFa3wTx4)h;}DvU4K=!ez@vgcv|BDuPf!p(a28Q4|U&w4xA5fM`fC34)g@Rjc-s zRxDJpVzt#)tJcy=D^`?k)k+JkSm_6TYQ}z2&mAr|xZmDR=&qaa z{b%?G@&Eh$AEJShVi>Zpz)bG>`=aMo<138(vdJ@>l8@o9F|Xj?JhR*+jTyhJxv}DZ z*Jpy{p*F!hq!Y$`F;Qp|kmZ|=_}j_!lH7Hbzun~TPldZx{(jMPHTx1@F{{R%F?0-K zFbF$0uUdHDl)show-f#*%!3ldG2FwhwMwnm8dW=8>Lxln$0p?M;P8u;J(BSX6F6A$v&pQ z^f0D!KxO}9`u86`f5_N*gB_SRq;K*_v=V(X?w>ugzV4h%Ql%*}M}(wd!!zRnW>kYr zv8l{vWyPk{(PpSQ-kAB!%FqgzGlla8i(uZ6u_~xMwi5ZCKe&26QW<83;6DV7h8tQD z4K%bOBSe)s#+;Oym@PqOdXlwBl2uhT6q3bYF7d}YW1(u|vA^Vs+sefCd3KVzj zykkQ^{r`~q4@G0G#xh8i=10`OkeE_59*3#_yQu$6Ry4MdI@a86PC$8%RV7M{^N&T| zvIJy6neP7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