Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes set  implemtations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "set  implemtations" Watch "set  implemtations" New topic
Author

set implemtations

Jeff Gaer
Ranch Hand

Joined: Jun 04, 2001
Posts: 99
How do the hashset and treeset classes determine uniqueness? Is it a test on the object reference, results of the equals method on the object? Is there a comparable or comparator associated with the set class? Or does one need to implement that on the objects being stored? What if there are different types of objects in the set? Good reading reference?
------------------
Thanks in advance for any help
Jeff Gaer


Sun Certified Java Programmer Java 2<P>Jeff Gaer
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

It makes sense to get an overview of the Collections implementation on your way to getting into the particulars of Set classes.
Doug Lea is a major authority on Java, primarily known for his work on multi-threading. I think you'll find this link very informative.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: set implemtations
 
Similar Threads
garbage collection
How objects are stored in arraylist
about variable persistence...
Arrays and GC
Interesting problem in Java with pass by reference