Find data in a hashset
Ihave an hashset of objects.
I want to search for a field in the object ex. object.name.
Do i have to iterate the hashset or is there another way ?
The whole object can be found with contains.
But i want to search for one field only.
Using getter methods u can retreive the contents.
Refer the api for Hashset.
HashSet (Java 2 Platform SE v1.4.2)
Put your code also with comments and where you need assistance.
How do i do that.
I do not find any get() into the hashSet, Set, Collection ....
I have a hashSet<project>
This "project" contains a Customer Class (and other).
1) What do i have to do when i want to search for the name attribute in the Customer class ?
2) How can i find an object when i have the HashCode ?