File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "set  implemtations" Watch "set  implemtations" New topic

set implemtations

Jeff Gaer
Ranch Hand

Joined: Jun 04, 2001
Posts: 103
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

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
I agree. Here's the link:
subject: set implemtations
It's not a secret anymore!