Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Advanced-java] Ordered sets?


  • From: Brian.Cain@xxxxxxxxxxxx (Cain Brian-BCAIN1)
  • Subject: [Advanced-java] Ordered sets?
  • Date: Wed, 30 Jan 2002 12:03:58 -0600

	I've got a question about ordered sets.  I'd like to use a set, that has order, but I don't want to implement a natural ordering of these elements.  I'd prefer to use the order in which they were added to the set (I don't think the elements of the set need to know, nor should know, the order in which they were added).  

	I know the HashSet's iterator comes "in no particular order", but does anyone know if it was implemented such that I'll end up with the results I want anyways?  It seems like a tremendous waste of effort to intentionally entropize a set's order, so I have to imagine that the elements are added in some logical fashion, right?  Is there a set in the JDK that I'm missing out on, that does what I want?

-Brian