Hi I am creating a project in Java using "Data Structures". I have created two classes called ClassID and ClassRecord. ClassID holds transaction information of a access control system (for personnel exiting and entering a secure door) while the ClassRecord allow transaction items to be added into a *.txt file(flat file) as well as to search , print items based on staff 's last name or ID number.
I am able to create a text file containing list of information ......the out put looks like this
Jones (surname)
5456 (ID number)
20 (access control number)
0902 (time of transaction)
1 (entering(1)/exiting(0))
Scott
1539
18
0920
0
My question is how can i read those information into a LinkList and sort the access control transactions by the amount of time,name,and ID number the personnal stayed inside secure premise.
Please any help appreciated.
Data StructuresData Structures and Algorithms
Page 1 of 1
2 Replies - 1496 Views - Last Post: 09 October 2007 - 02:43 AM
Replies To: Data Structures
#2
Re: Data Structures
Posted 08 October 2007 - 08:14 PM
Well, I'm not sure bout the main problem. However, those kind of stuff could be done by doing the following :
1- make a class that has the ( surename, ID, access number.....) as attributes; if you don't have it yet.
2- on the main class or wherever you read from the file, after reading the info. you store them on a variable of the class type you did in 1.
3- then, add a new Node on a linkedList and store the variable you made in 2 as the Data for this node.
Hopefully that helps,,,
1- make a class that has the ( surename, ID, access number.....) as attributes; if you don't have it yet.
2- on the main class or wherever you read from the file, after reading the info. you store them on a variable of the class type you did in 1.
3- then, add a new Node on a linkedList and store the variable you made in 2 as the Data for this node.
Hopefully that helps,,,
#3
Re: Data Structures
Posted 09 October 2007 - 02:43 AM
malqa053, on 8 Oct, 2007 - 08:14 PM, said:
Well, I'm not sure bout the main problem. However, those kind of stuff could be done by doing the following :
1- make a class that has the ( surename, ID, access number.....) as attributes; if you don't have it yet.
2- on the main class or wherever you read from the file, after reading the info. you store them on a variable of the class type you did in 1.
3- then, add a new Node on a linkedList and store the variable you made in 2 as the Data for this node.
Hopefully that helps,,,
1- make a class that has the ( surename, ID, access number.....) as attributes; if you don't have it yet.
2- on the main class or wherever you read from the file, after reading the info. you store them on a variable of the class type you did in 1.
3- then, add a new Node on a linkedList and store the variable you made in 2 as the Data for this node.
Hopefully that helps,,,
Okay, I got the picture..........well let me try that pseudo in code ,thanks a lot
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|