Class ByteSets.Singleton

java.lang.Object
java.util.AbstractCollection<Byte>
it.unimi.dsi.fastutil.bytes.AbstractByteCollection
it.unimi.dsi.fastutil.bytes.AbstractByteSet
it.unimi.dsi.fastutil.bytes.ByteSets.Singleton
All Implemented Interfaces:
it.unimi.dsi.fastutil.bytes.ByteCollection, it.unimi.dsi.fastutil.bytes.ByteIterable, ByteSet, Serializable, Cloneable, Iterable<Byte>, Collection<Byte>, Set<Byte>
Direct Known Subclasses:
ByteSortedSets.Singleton
Enclosing class:
ByteSets

public static class ByteSets.Singleton extends AbstractByteSet 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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final byte
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Singleton(byte element)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addAll(it.unimi.dsi.fastutil.bytes.ByteCollection c)
     
    boolean
    addAll(Collection<? extends Byte> c)
     
     
    boolean
    contains(byte k)
     
    void
    forEach(it.unimi.dsi.fastutil.bytes.ByteConsumer action)
     
    void
    forEach(Consumer<? super Byte> action)
    Deprecated.
    it.unimi.dsi.fastutil.ints.IntIterator
     
    it.unimi.dsi.fastutil.ints.IntSpliterator
     
    it.unimi.dsi.fastutil.bytes.ByteListIterator
    Returns a type-specific iterator on the elements of this set.
    boolean
    remove(byte k)
    Removes an element from this set.
    boolean
    removeAll(it.unimi.dsi.fastutil.bytes.ByteCollection c)
     
    boolean
     
    boolean
    removeIf(it.unimi.dsi.fastutil.bytes.BytePredicate filter)
     
    boolean
    removeIf(Predicate<? super Byte> filter)
    Deprecated.
    boolean
    retainAll(it.unimi.dsi.fastutil.bytes.ByteCollection c)
     
    boolean
     
    int
     
    it.unimi.dsi.fastutil.bytes.ByteSpliterator
    Returns a type-specific spliterator on the elements of this set.
    Deprecated.
    byte[]
     

    Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteSet

    equals, hashCode, rem

    Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteCollection

    add, add, contains, containsAll, containsAll, remove, toArray, toByteArray, toString

    Methods inherited from class java.util.AbstractCollection

    clear, isEmpty, toArray

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection

    add, containsAll, intParallelStream, intStream, parallelStream, removeIf, stream, toArray, toByteArray

    Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteIterable

    forEach

    Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteSet

    add, contains, remove

    Methods inherited from interface java.util.Collection

    toArray

    Methods inherited from interface java.util.Set

    clear, containsAll, isEmpty, toArray
  • Field Details

    • element

      protected final byte element
  • Constructor Details

    • Singleton

      protected Singleton(byte element)
  • Method Details

    • contains

      public boolean contains(byte k)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
    • remove

      public boolean remove(byte k)
      Description copied from class: AbstractByteSet
      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 ByteSet
      Overrides:
      remove in class AbstractByteSet
      See Also:
    • iterator

      public it.unimi.dsi.fastutil.bytes.ByteListIterator iterator()
      Description copied from interface: ByteSet
      Returns a type-specific iterator on the elements of this set.
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.bytes.ByteIterable
      Specified by:
      iterator in interface ByteSet
      Specified by:
      iterator in interface Collection<Byte>
      Specified by:
      iterator in interface Iterable<Byte>
      Specified by:
      iterator in interface Set<Byte>
      Specified by:
      iterator in class AbstractByteSet
      Returns:
      a type-specific iterator on the elements of this set.
    • spliterator

      public it.unimi.dsi.fastutil.bytes.ByteSpliterator spliterator()
      Description copied from interface: ByteSet
      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 it.unimi.dsi.fastutil.bytes.ByteCollection
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.bytes.ByteIterable
      Specified by:
      spliterator in interface ByteSet
      Specified by:
      spliterator in interface Collection<Byte>
      Specified by:
      spliterator in interface Iterable<Byte>
      Specified by:
      spliterator in interface Set<Byte>
      Returns:
    • size

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

      public byte[] toByteArray()
      Specified by:
      toByteArray in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Overrides:
      toByteArray in class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
    • forEach

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

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

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

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

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

      public void forEach(it.unimi.dsi.fastutil.bytes.ByteConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.bytes.ByteIterable
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.bytes.ByteCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
    • removeAll

      public boolean removeAll(it.unimi.dsi.fastutil.bytes.ByteCollection c)
      Specified by:
      removeAll in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
    • retainAll

      public boolean retainAll(it.unimi.dsi.fastutil.bytes.ByteCollection c)
      Specified by:
      retainAll in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
    • removeIf

      public boolean removeIf(it.unimi.dsi.fastutil.bytes.BytePredicate filter)
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.bytes.ByteCollection
    • intIterator

      public it.unimi.dsi.fastutil.ints.IntIterator intIterator()
      Specified by:
      intIterator in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Specified by:
      intIterator in interface it.unimi.dsi.fastutil.bytes.ByteIterable
    • intSpliterator

      public it.unimi.dsi.fastutil.ints.IntSpliterator intSpliterator()
      Specified by:
      intSpliterator in interface it.unimi.dsi.fastutil.bytes.ByteCollection
      Specified by:
      intSpliterator in interface it.unimi.dsi.fastutil.bytes.ByteIterable
    • toArray

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

      public Object clone()
      Overrides:
      clone in class Object