Class IdentityHashSet<E>

  • Type Parameters:
    E - the type of the elements of the set.
    All Implemented Interfaces:
    Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>

    public class IdentityHashSet<E>
    extends AbstractSet<E>
    implements Set<E>, Cloneable, Serializable
    This Set relies on identity (==) to compare the objects it contains. It does not matter what the objects Object.equals(java.lang.Object) methods say.

    This collection is Cloneable and Serializable. If you clone an instance of an IdentityHashSet, the clone is equal to the original instance (i.e. original.equals(clone) == true and clone.equals(original) == true). However this is not true for serialization, a deserialized instance of IdentityHashSet is not equal to the instance originally serialized (i.e. original.equals(deserialized) == false and deserialized.equals(original) == false).

    Since:
    1.0.0
    Author:
    Thomas Leplus
    See Also:
    Serialized Form