I need a list to store pairs of short strings with the ability to use either
string to return the other (kind of like a map). Say the stings are an IP address and the other a computer name. I'd like to be able to do something like:
String name = getName(ipAddr); and
Sting ipAddr = getIP(name);
I'd also like to be able traverse the entries to get each ipAddress;
Is there a
java list that has this capability or should I roll my own? Right now, for
testing, I'm using HashTable. I think that accessing the list should be
thread safe as well - but I've not learned enough about that yet.
My list will be small, probably less than half a dozen entries.
Thanks,
Nate