Class ImmutableSet<E>

Type Parameters:
E -
All Implemented Interfaces:
Immutable, Iterable<E>, Collection<E>, Set<E>
Direct Known Subclasses:
ImmutableSortedSet, Iterables.SetView

public class ImmutableSet<E> extends ImmutableCollection<E> implements Set<E>
Since:
0.8
Author:
Haiyang Li
  • Method Details

    • empty

      public static <E> ImmutableSet<E> empty()
      Type Parameters:
      E -
      Returns:
    • just

      public static <T> ImmutableSet<T> just(T e)
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • of

      public static <T> ImmutableSet<T> of(T e1)
      Type Parameters:
      T -
      Parameters:
      e1 -
      Returns:
    • of

      public static <T> ImmutableSet<T> of(T e1, T e2)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • of

      public static <T> ImmutableSet<T> of(T e1, T e2, T e3)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • of

      public static <T> ImmutableSet<T> of(T e1, T e2, T e3, T e4)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      Returns:
    • of

      public static <T> ImmutableSet<T> of(T e1, T e2, T e3, T e4, T e5)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      Returns:
    • of

      public static <T> ImmutableSet<T> of(T e1, T e2, T e3, T e4, T e5, T e6)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      Returns:
    • of

      public static <T> ImmutableSet<T> of(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • of

      @SafeVarargs public static <E> ImmutableSet<E> of(E... a)
      Type Parameters:
      E -
      Parameters:
      a -
      Returns:
    • copyOf

      public static <E> ImmutableSet<E> copyOf(Collection<? extends E> set)
      Type Parameters:
      E -
      Parameters:
      set -
      Returns:
    • wrap

      public static <E> ImmutableSet<E> wrap(Set<? extends E> set)
      Type Parameters:
      E -
      Parameters:
      set -
      Returns:
      an ImmutableSet backed by the specified set
    • wrap

      @Deprecated public static <E> ImmutableCollection<E> wrap(Collection<? extends E> c) throws UnsupportedOperationException
      Deprecated.
      throws UnsupportedOperationException
      Type Parameters:
      E -
      Parameters:
      c -
      Returns:
      Throws:
      UnsupportedOperationException
    • builder

      public static <E> ImmutableSet.Builder<E> builder()
      Type Parameters:
      E -
      Returns:
    • builder

      public static <E> ImmutableSet.Builder<E> builder(Set<E> holder)
      Type Parameters:
      E -
      Parameters:
      holder -
      Returns: