Friday, June 27, 2003 09:52 AM
A Hashtable or a HashMap would do what you need.
You can use the object itself as a hash or some unique attribute or combination of attributes as the hash object.
Check out Hashtable (for synchronized methods) and HashMap (for unsynchronized methods) in the JavaDocs.
If you want the objects to return in an Iterator in a specific order, then you could use LinkedHashSet or LinkedHashMap.
The collections classes in java.util.* are really powerful if you begin reading the Java Tutorials and JavaDocs.