[Java]Setting the order of a Hashtable?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

[Java]Setting the order of a Hashtable?

Post 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 :)
Post Reply