class LinkedHashSet<E> implements
interface Set<E>
LinkedHashSet implementation the same as
HashSet and additionally maintains a doubly-linked list running through all of its elements. This linked list makes guarantees order of items in the set.
class LinkedHashSet is not synchronized. If multiple threads access a
LinkedHashSet concurrently, and at least one of the threads modifies the
LinkedHashSet, then
LinkedHashSet must be synchronized. Usually this is synchronization, it is done like this:
Set mySet1 = Collections.synchronizedSet( new LinkedHashSet(...) );