Class ImmutableMultiList.SetView

All Implemented Interfaces:
Serializable, Iterable, Collection, Set
Enclosing class:
ImmutableMultiList

protected class ImmutableMultiList.SetView extends WrapperCollections.AbstractWrapperSet
SetView exposes the underlying ImmutableMultiList through the Set interface, maintaining correct equals() and hashCode() semantics
See Also:
  • Constructor Details

    • SetView

      protected SetView()
      Create a SetView over this ImmutableMultiList.
  • Method Details

    • equals

      public boolean equals(Object o)
      Compares the specified object with this set for equality. Returns true if the specified object is also a set, the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set). This definition ensures that the equals method works properly across different implementations of the set interface.
      Specified by:
      equals in interface Collection
      Specified by:
      equals in interface Set
      Overrides:
      equals in class WrapperCollections.AbstractWrapperCollection
      Parameters:
      o - Object to be compared for equality with this set.
      Returns:
      true if the specified Object is equal to this set.
    • hashCode

      public int hashCode()
      Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set, where the hashcode of a null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of the Object.hashCode method.
      Specified by:
      hashCode in interface Collection
      Specified by:
      hashCode in interface Set
      Overrides:
      hashCode in class WrapperCollections.AbstractWrapperCollection
      Returns:
      the hash code value for this set.
      See Also: