Page 1 of 1

[Java]Setting the order of a Hashtable?

Posted: Sun Nov 27, 2005 4:59 pm
by Jenk
Hihi!

Creating a small app to store properties in a Java Properties file, namely it's a CD Catalog/Inventory of the Installation CD's for various bits of software that we keep in a cupboard. The purpose is to keep a check on who has what CD etc. (e.g. MS Visio - checked out by bob on the 14th)

The main problem I am having at the moment is when it comes to adding a new CD to the collection, namely with the creation of a new Reference number (auto-increment from the highest number is what I want to achieve)

No database, just good old flat files. So am reading in the files with the java.util.Properties.list(file) method (as an object, not statically)

The data is in the form of <ref>.<property>=<value>, e.g. :

001.name=MS Visio
001.owner=bob
001.outdate=14/10/2005
001.lock=On

Any assistance, or suggestions for a better method of storing the data (MUST be flat files though :() would be greatly appreciated :)