Re: Is there a Class like HashMap, but...
From: Scott Ellsworth (scott_at_alodar.com)
Date: 12/30/04
- Next message: Julia Donawald: "general question to aspect-oriented-programming"
- Previous message: bb: "tomcat context url"
- In reply to: ByteCoder: "Re: Is there a Class like HashMap, but..."
- Next in thread: Sudsy: "Re: Is there a Class like HashMap, but..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Dec 2004 14:35:15 -0800
In article <33gqmqF3vpia3U1@individual.net>,
ByteCoder <ByteCoder@127.0.0.1> wrote:
> ByteCoder wrote:
> > ByteCoder wrote:
> >
> >> Is there a Class like HashMap, but which only stores the key.
> >>
> >> Basicly, I want a Class which adds unique objects to it, but which
> >> overwrites non-unique objects.
> >>
> >> TIA,
> >
> >
> > I finally found it, it's the HashSet. :)
> >
>
> One more thing: Does the HashSet has some sort of get method, so that I
> don't have to use an Iterator if I just want to get one object?
> Or wouldn't that be a problem if my HashSet has about 200 elements?
If you want to see whether a given object is in the set, use contains().
If you want to get all the objects in a set, use iterator, and if you
just want "any old object", use iterator().next().
Scott
- Next message: Julia Donawald: "general question to aspect-oriented-programming"
- Previous message: bb: "tomcat context url"
- In reply to: ByteCoder: "Re: Is there a Class like HashMap, but..."
- Next in thread: Sudsy: "Re: Is there a Class like HashMap, but..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|