An interesting note about using Java maps if you're not using strings as keys - If you use a HashMap?, you won't be able to dependably retrieve objects unless the class of the key overrides hashCode() (and probably equals(), like Pulsar said), and if you use a TreeMap?, you must implement the Comparable interface in the key class for it to work correctly. Quite a few of the standard libraries already do these things (like String), but it's something to make sure about. -- Kawigi Yeah, that's why I use String objects as keys. Though implementing hashCode() and equals() isn't too much of a bother. But String objects work as good as anything else for the purposes I use them for here, -- PEZ
|