• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data conversion tool

 
Sri Parthas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I registered for the SCJD on nov 28 and still got the project with
text file. Need to write the data conversion tool.
After reading through the given code I had a few questions.May be I
am tinking too much, but hope some one can clarify.
(1) In the text file given there is no explicit record number field (
starts with flight number). while I am converting this text file to
binary I am planning to add a unique record number field as the
first field in the binary file. Am I justified in doing this?
My Reasons for doing it:
a. Persistance of data in the binary file, that is if I don't add a
record number field then once the program stops running the record
number information associated with a record is gone.
b. Also in the find method ( given along with the project) of the
Data class the javadoc states " For this assignment, the key field is
the record number filed" and the search for the record is done using
values[0].equls(toMatch). To me this means that the first field
should be record number.
My confusion stems from the following fact.
If record number is going to be the first field of the record, then
why should the DataInfo class ( given with project) hava a separate
private variable recordNumber. The recordNumber information can be
derived from values[0] ? Aren't we creating a redundant variable
here?
Hoping to hear some response. ( Sorry this was long ...)

Thanks
-Sri
 
Praveen Kannan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sri Parthas,
I am also working on the same module, but i am not adding any record number. Reason is, if you look closely at the getRecord() method in Data class, the integer parameter is used to seek through the file to the particular record, using the record length calculations. Of course, it is my point of view. Do anyone else view it differently???
Praveen.K
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic