commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: [math] Bug fixes
Date Thu, 08 Jan 2004 16:11:07 GMT
Sorry, that may have be a bit naive. More specifically, I know that 
open/closeReplay file reloads the values file inputstream. I suspect 
that these are only used in one other location in the ValueServer. Maybe 
they should be private or consolidated into the getNExtReplay method.

254     /***
255      * Opens <code>valuesFilePath</code> to use in REPLAY_MODE.
256      *
257      * @throws IOException if an error occurs opening the file
258      */
259     public void openReplayFile() throws IOException {
260         filePointer = new BufferedReader(new FileReader
261                             (new File(valuesFileURL.getFile())));
262     }
263
264     /***
265      * Closes <code>valuesFilePath</code> after use in REPLAY_MODE.
266      *
267      * @throws IOException if an error occurs closing the file
268      */
269     public void closeReplayFile() throws IOException {
270         if (filePointer != null) {
271             filePointer.close();
272             filePointer = null;
273         }
274     }

339     private double getNextReplay() throws IOException {
340         String str = null;
341         if (filePointer == null) {
342             throw new IllegalStateException("replay file not open");
343         }
344         if ((str = filePointer.readLine()) == null) {
345             closeReplayFile();
346             openReplayFile();
347             str = filePointer.readLine();
348         }
349         return new Double(str).doubleValue();
350     }


Mark R. Diggory wrote:

> Yes, I agree too, although it would be beneficial to maintain so 
> convenience methods that allow one to set the source of the streams to 
> be a File or other often used objects.
> 
> What is the difference  between a "replay file" and a "values file"? Do 
> we have to have both of these or is there a way to make it more generic?
> 
> -Mark
> 
> Phil Steitz wrote:
> 
>> Al Chou wrote:
>>
>>> --- Phil Steitz <phil@steitz.com> wrote:
>>>
>>>> I would like to fix PR #25972 and tidy up a few other things.  Any 
>>>> objections to my adding myself to STATUS and committing, or shall I 
>>>> submit patches?
>>>>
>>>> Phil
>>>
>>>
>>>
>>>
>>> I don't understand why the bug report is filed against Math, but I'm 
>>> fine with
>>> you going ahead, Phil.
>>
>>
>>
>> ValueServer is a class in the o.a.c.m.random package. I agree with 
>> Bill that this class and EmpiricalDistribution should have been 
>> implemented using streams instead of File objects.
>>
>> Phil
>>
>>>
>>>
>>> Al
>>>
>>> =====
>>> Albert Davidson Chou
>>>
>>>     Get answers to Mac questions at http://www.Mac-Mgrs.org/ .
>>>
>>> __________________________________
>>> Do you Yahoo!?
>>> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
>>> http://hotjobs.sweepstakes.yahoo.com/signingbonus
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
> 

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message