Return-Path: Delivered-To: apmail-jakarta-poi-dev-archive@www.apache.org Received: (qmail 527 invoked from network); 13 Jun 2005 19:37:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jun 2005 19:37:19 -0000 Received: (qmail 28253 invoked by uid 500); 13 Jun 2005 19:37:18 -0000 Delivered-To: apmail-jakarta-poi-dev-archive@jakarta.apache.org Received: (qmail 28225 invoked by uid 500); 13 Jun 2005 19:37:18 -0000 Mailing-List: contact poi-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "POI Developers List" Reply-To: "POI Developers List" Delivered-To: mailing list poi-dev@jakarta.apache.org Received: (qmail 28208 invoked by uid 99); 13 Jun 2005 19:37:17 -0000 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=FORGED_RCVD_HELO,NO_REAL_NAME,RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from DSL-KK-static-216.183.145.203.touchtelindia.net (HELO geriatrix.itellix.net) (203.145.183.216) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 13 Jun 2005 12:37:15 -0700 Received: from getafix.dm.itellix.net (getafix.dm.itellix.net [10.0.1.2]) by geriatrix.itellix.net (Postfix) with ESMTP id 6DECE4310B3 for ; Tue, 14 Jun 2005 00:24:44 +0530 (IST) Received: by getafix.dm.itellix.net (Postfix, from userid 98) id 0C299DF4E6; Tue, 14 Jun 2005 00:02:53 +0530 (IST) Received: from 202.56.231.117 ([202.56.231.117]) by 203.145.183.216 (Horde) with HTTP for ; Tue, 14 Jun 2005 00:02:52 +0530 Message-ID: <20050614000252.nbb8pfwnk84gk4kk@203.145.183.216> Date: Tue, 14 Jun 2005 00:02:52 +0530 From: Avik.sengupta@itellix.com To: poi-dev@jakarta.apache.org Subject: RE: FormulaRecord getValue &setVal ue enhancement References: <20050613123842.51565.qmail@web32005.mail.mud.yahoo.com> In-Reply-To: <20050613123842.51565.qmail@web32005.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Mobile Internet Messaging Program (MIMP) 0.1-cvs X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Can you put in the changes to the record and the aggregate ? I think your mail brings out an important point... Of how to provide high level access to formulas. Something i've put some thought to recently... But its the subject of another mail, and much debate. Sorry he you received an empty mail earlier.Quoting Amol Deshmukh : > > > --- avik.sengupta@itellix.com wrote: >> This will break existing code. Very Bad Thing! Also, >> with my Alan Cooper fanboy >> hat on, I think recommending to /prefer/ calling >> setCellType() is in itself a Bad Thing. > > It wouldnt break existing code since existing code > would be throwing CastClassException anyway :) But I > get your point and am glad we had this discussion. > > >> >> I would say, add a method called >> setCellFormulaResult() overloaded for >> string/num etc. > > Yeah, probably a better option! Although maybe, I can > do something like: > Create inner nested class Formula which has the > overloaded setCellFormulaResult(..) methods (& a > constructor that takes in the formula string)... and > add setCellValue(HSSFCell.Formula f) to HSSFCell. This > will keep the HSSFCell api clean since it will just > add two methods (getFormulaValue/setCellValue(Formula > f) - and I can make the javadocs very clear about > how/when to use these method :) > > >> I am sure we can fix the class cast exception on >> calling setCellFormula >> followed >> setCellValue independently. > > True. I should have thought of that! :) So now in > setCellValue(..) methods we can change: > if ((cellType != CELL_TYPE_STRING ) > && (cellType != CELL_TYPE_FORMULA)) > { > setCellType(CELL_TYPE_STRING, false); > } > > --TO-- > if ((cellType != CELL_TYPE_STRING )) > { > setCellType(CELL_TYPE_STRING, false); > } > > [Since we will have a setCellValue(Formula f) that > will take care of the formula with initial value] > > Regards, > ~ amol > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org > Mailing List: http://jakarta.apache.org/site/mail2.html#poi > The Apache Jakarta POI Project: http://jakarta.apache.org/poi/ > > --------------------------------------------------------------------- To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta POI Project: http://jakarta.apache.org/poi/