Interface ImmutableSet<E>

Type Parameters:
E - the type of content of this Set
All Superinterfaces:
ImmutableCollection<E>, Iterable<E>, Serializable
All Known Subinterfaces:
ImmutableNavigableSet<E>, ImmutableSortedSet<E>
All Known Implementing Classes:
ImmutableAbstractSet, ImmutableHashSet, ImmutableLinkedHashSet, ImmutableTreeSet

public interface ImmutableSet<E>
extends ImmutableCollection<E>
A Set interface without the methods that can change it. The constructor of the ImmutableSet needs to be given an initial Set.

Copyright (c) 2016-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Method Details

    • toSet

      Set<E> toSet()
      Returns a modifiable copy of this immutable set.
      Returns:
      a modifiable copy of this immutable set.
    • equals

      boolean equals​(Object obj)
      Force to redefine equals for the implementations of immutable collection classes.
      Specified by:
      equals in interface ImmutableCollection<E>
      Overrides:
      equals in class Object
      Parameters:
      obj - Object; the object to compare this collection with
      Returns:
      whether the objects are equal
    • hashCode

      int hashCode()
      Force to redefine hashCode for the implementations of immutable collection classes.
      Specified by:
      hashCode in interface ImmutableCollection<E>
      Overrides:
      hashCode in class Object
      Returns:
      the calculated hashCode
    • toString

      String toString()
      Force to redefine toString.
      Overrides:
      toString in class Object
      Returns:
      String; a description of this immutable set