Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 5 General Forum
Date: Thu Nov 15 2001 11:47 pm
Author: Goodman, Brian J. <bjg@andrew.cmu.edu>
Subject: Re: How to save

The format of your files is really up to you. Just make sure that you're able restore your index to its orginal state if you restore from a saved file.

I'll throw out a naive approach of:
-Maintain a structure in your index that holds everything that addPage has ever been called with
-Save this structure to the file when the save method is called
-To restore, simply call addPage with the contents of your file and then call makeIndex.

Please only use this as a last resort. I haven't tried doing it this way, so while it is conceptually easy and probably quite easy to implement, it may or may not cause you to run out of memory (I really don't know) since you'll have that extra data structure to maintain in your index.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
How to save      Chui, Alex Yincheung Alex      Thu Nov 15 2001 10:10 pm       
Re: How to save      Goodman, Brian J.      Thu Nov 15 2001 11:47 pm       
Re: How to save      Kohl, Charles M.      Fri Nov 16 2001 12:49 am       
Re: How to save      Ghosh, Debmallo S.      Fri Nov 16 2001 8:45 am       
Re: How to save      Lee, Peter      Sat Nov 17 2001 3:53 pm       

Back to previous screen