Return-Path: Delivered-To: apmail-jakarta-poi-dev-archive@www.apache.org Received: (qmail 61377 invoked from network); 13 Jun 2005 12:38:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jun 2005 12:38:54 -0000 Received: (qmail 68036 invoked by uid 500); 13 Jun 2005 12:38:53 -0000 Delivered-To: apmail-jakarta-poi-dev-archive@jakarta.apache.org Received: (qmail 67991 invoked by uid 500); 13 Jun 2005 12:38:53 -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 67937 invoked by uid 99); 13 Jun 2005 12:38:52 -0000 X-ASF-Spam-Status: No, hits=3.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,FORGED_YAHOO_RCVD X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web32005.mail.mud.yahoo.com (HELO web32005.mail.mud.yahoo.com) (68.142.207.102) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 13 Jun 2005 05:38:49 -0700 Received: (qmail 51567 invoked by uid 60001); 13 Jun 2005 12:38:43 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5OF9rzh6e8D7Y6dfgUSdEsaMTTbTzpdPjR/nU0kg0SXvNVsEhOKgsmw5WW39qkgrjMtbtcCVuncswgEkTx98j0wSj3n8cu00WwjqxtNI+cBJqYvEe5jyP9kKq9imP5grwgolPDnDfb9yFHqyBV5YLtRMXPjVE99egO2+EuNlUws= ; Message-ID: <20050613123842.51565.qmail@web32005.mail.mud.yahoo.com> Received: from [207.0.184.50] by web32005.mail.mud.yahoo.com via HTTP; Mon, 13 Jun 2005 05:38:42 PDT Date: Mon, 13 Jun 2005 05:38:42 -0700 (PDT) From: Amol Deshmukh Subject: RE: FormulaRecord getValue &setVal ue enhancement To: POI Developers List In-Reply-To: <20050611110113.d2e7lr9uw480sw88@www.itellix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --- 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/