Class IntSets.Singleton

java.lang.Object
java.util.AbstractCollection<Integer>
it.unimi.dsi.fastutil.ints.AbstractIntCollection
it.unimi.dsi.fastutil.ints.AbstractIntSet
it.unimi.dsi.fastutil.ints.IntSets.Singleton
All Implemented Interfaces:
it.unimi.dsi.fastutil.ints.IntCollection, it.unimi.dsi.fastutil.ints.IntIterable, IntSet, Serializable, Cloneable, Iterable<Integer>, Collection<Integer>, Set<Integer>
Direct Known Subclasses:
IntSortedSets.Singleton
Enclosing class:
IntSets

public static class IntSets.Singleton extends AbstractIntSet implements Serializable, Cloneable
An immutable class representing a type-specific singleton set.

This class may be useful to implement your own in case you subclass a type-specific set.

See Also:
  • Field Details

    • element

      protected final int element
  • Constructor Details

    • Singleton

      protected Singleton(int element)
  • Method Details

    • contains

      public boolean contains(int k)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.ints.IntCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • remove

      public boolean remove(int k)
      Description copied from class: AbstractIntSet
      Removes an element from this set. Delegates to the type-specific rem() method implemented by type-specific abstract Collection superclass.
      Specified by:
      remove in interface IntSet
      Overrides:
      remove in class AbstractIntSet
      See Also:
    • iterator

      public it.unimi.dsi.fastutil.ints.IntListIterator iterator()
      Description copied from interface: IntSet
      Returns a type-specific iterator on the elements of this set.
      Specified by:
      iterator in interface Collection<Integer>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.ints.IntCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.ints.IntIterable
      Specified by:
      iterator in interface IntSet
      Specified by:
      iterator in interface Iterable<Integer>
      Specified by:
      iterator in interface Set<Integer>
      Specified by:
      iterator in class AbstractIntSet
      Returns:
      a type-specific iterator on the elements of this set.
    • spliterator

      public it.unimi.dsi.fastutil.ints.IntSpliterator spliterator()
      Description copied from interface: IntSet
      Returns a type-specific spliterator on the elements of this set.

      Set spliterators must report at least Spliterator.DISTINCT.

      See Set.spliterator() for more documentation on the requirements of the returned spliterator.

      Specified by:
      spliterator in interface Collection<Integer>
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.ints.IntCollection
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.ints.IntIterable
      Specified by:
      spliterator in interface IntSet
      Specified by:
      spliterator in interface Iterable<Integer>
      Specified by:
      spliterator in interface Set<Integer>
      Returns:
    • size

      public int size()
      Specified by:
      size in interface Collection<Integer>
      Specified by:
      size in interface Set<Integer>
      Specified by:
      size in class AbstractCollection<Integer>
    • toIntArray

      public int[] toIntArray()
      Specified by:
      toIntArray in interface it.unimi.dsi.fastutil.ints.IntCollection
      Overrides:
      toIntArray in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • forEach

      @Deprecated public void forEach(Consumer<? super Integer> action)
      Deprecated.
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.ints.IntIterable
      Specified by:
      forEach in interface Iterable<Integer>
    • addAll

      public boolean addAll(Collection<? extends Integer> c)
      Specified by:
      addAll in interface Collection<Integer>
      Specified by:
      addAll in interface Set<Integer>
      Overrides:
      addAll in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<Integer>
      Specified by:
      removeAll in interface Set<Integer>
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • retainAll

      public boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<Integer>
      Specified by:
      retainAll in interface Set<Integer>
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • removeIf

      @Deprecated public boolean removeIf(Predicate<? super Integer> filter)
      Deprecated.
      Specified by:
      removeIf in interface Collection<Integer>
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.ints.IntCollection
    • forEach

      public void forEach(IntConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.ints.IntIterable
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.ints.IntCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.ints.IntCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • removeAll

      public boolean removeAll(it.unimi.dsi.fastutil.ints.IntCollection c)
      Specified by:
      removeAll in interface it.unimi.dsi.fastutil.ints.IntCollection
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • retainAll

      public boolean retainAll(it.unimi.dsi.fastutil.ints.IntCollection c)
      Specified by:
      retainAll in interface it.unimi.dsi.fastutil.ints.IntCollection
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.ints.AbstractIntCollection
    • removeIf

      public boolean removeIf(IntPredicate filter)
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.ints.IntCollection
    • toArray

      @Deprecated public Object[] toArray()
      Deprecated.
      Specified by:
      toArray in interface Collection<Integer>
      Specified by:
      toArray in interface Set<Integer>
      Overrides:
      toArray in class AbstractCollection<Integer>
    • clone

      public Object clone()
      Overrides:
      clone in class Object