Questions tagged [linkedhashset]

LinkedHashSet is a variant of HashSet

Fundamental:

LinkedHashSet is a variant of HashSet. Its entries are kept in a doubly-linked list. The iteration order is the order in which entries were inserted.

Null elements are allowed, and all the optional Set operations are supported.

Like HashSet, LinkedHashSet is not thread safe, so access by multiple threads must be synchronized by an external mechanism such as synchronizedSet(Set).

153 questions
-3
votes
1 answer

Find an Item in a LinkedHashSet

I have a bean putting a query into a LinkedHashSet as I want the results going in the order the query is. The query going in as an example is id, forename, surname...... How can I find a name in the LinkedHashSet and return the element number for…
user3805878
  • 13
  • 1
  • 3
-4
votes
3 answers

Is there any way to get the items from HashSet in insertion order in java?

Our existing code using HashSet to store data's.I know Nature of the Set interface is giving random order.But i need the same insertion order.Is there any way to get the insertion order from the set??? Please guide me get out of this issue? I also…
Saravanan
  • 11,372
  • 43
  • 143
  • 213
-4
votes
4 answers

How to remove duplicates from ArrayList of type Object?

I want to remove duplicates from ArrayList of type Alerts where Alerts is a class. Class Alerts - public class Alerts implements Parcelable { String date = null; String alertType = null; String discription = null; public Alerts()…
sjain
  • 23,126
  • 28
  • 107
  • 185
1 2 3
10
11