You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dr. Evil" <dr...@sidereal.kz> on 2001/10/20 05:15:34 UTC

Java datatypes question: the Set

In the particular class that I'm working on, it would be extremely
handy to have an unordered collection of unique objects (strings)
which can grow as necessary.  This sounds exactly like the Set class.
However, Set is an abstract class, so I can't instantiate it.  Are
there any non-abstract classes that do what Set does?  I have seen
there is ArrayList, but that allows duplicate values and is ordered.
There is Vector, which is a lot like ArrayList.  There are the various
Map classes, but they are associations, which is totally different.
Any other classes I could be using?

Thanks from a java newbie.

I figured it out (was Re: Java datatypes question: the Set)

Posted by "Dr. Evil" <dr...@sidereal.kz>.
HashSet is what I want...

Re: Java datatypes question: the Set

Posted by Dmitri Colebatch <di...@bigpond.net.au>.
Have a look at Sun's
Javadoc...  http://java.sun.com/j2se/1.3/docs/api/index.html more
specifically http://java.sun.com/j2se/1.3/docs/api/java/util/HashSet.html

also - this is a very offtopic question.  you might find the java forums
are more helpful place:

http://forum.java.sun.com/

hth
dim

On Tue, 23 Oct 2001, paul wrote:

> Is java.util.HashTable any good
> 
> ----- Original Message ----- 
> From: "Dr. Evil" <dr...@sidereal.kz>
> To: <to...@jakarta.apache.org>
> Sent: Saturday, October 20, 2001 4:15 AM
> Subject: Java datatypes question: the Set
> 
> 
> > 
> > In the particular class that I'm working on, it would be extremely
> > handy to have an unordered collection of unique objects (strings)
> > which can grow as necessary.  This sounds exactly like the Set class.
> > However, Set is an abstract class, so I can't instantiate it.  Are
> > there any non-abstract classes that do what Set does?  I have seen
> > there is ArrayList, but that allows duplicate values and is ordered.
> > There is Vector, which is a lot like ArrayList.  There are the various
> > Map classes, but they are associations, which is totally different.
> > Any other classes I could be using?
> > 
> > Thanks from a java newbie.
> > 
> 
> 


Re: Java datatypes question: the Set

Posted by paul <pa...@roadrunner.uk.com>.
Is java.util.HashTable any good

----- Original Message ----- 
From: "Dr. Evil" <dr...@sidereal.kz>
To: <to...@jakarta.apache.org>
Sent: Saturday, October 20, 2001 4:15 AM
Subject: Java datatypes question: the Set


> 
> In the particular class that I'm working on, it would be extremely
> handy to have an unordered collection of unique objects (strings)
> which can grow as necessary.  This sounds exactly like the Set class.
> However, Set is an abstract class, so I can't instantiate it.  Are
> there any non-abstract classes that do what Set does?  I have seen
> there is ArrayList, but that allows duplicate values and is ordered.
> There is Vector, which is a lot like ArrayList.  There are the various
> Map classes, but they are associations, which is totally different.
> Any other classes I could be using?
> 
> Thanks from a java newbie.
>