posted 22 years ago
Well, a HashMap represents a set of key/value pairs. Given a key object, you want to be able to look up a corresponding value object. An array is basically a list of objects. (Or primitives.) The question is, how do the objects in the array relate to each other? Are they keys? Values? Perhaps all the even-numbered index positions in the array correspond to keys, and the following odd positions correspond to the values tha keys should be mapped to?
Basically, there's no one way to do this, and it really depends on the situation. What do the objects in the array represent? What does the Map represent? (Is there even any relationship \i{to} be mapped here?) Perhaps you could show an example of an array you're thinking of, and describe how the HashMap should relate to it.
[ August 14, 2002: Message edited by: Jim Yingst ]
"I'm not back." - Bill Harding, Twister