Class FloatSets.Singleton

java.lang.Object
java.util.AbstractCollection<Float>
it.unimi.dsi.fastutil.floats.AbstractFloatCollection
it.unimi.dsi.fastutil.floats.AbstractFloatSet
it.unimi.dsi.fastutil.floats.FloatSets.Singleton
All Implemented Interfaces:
it.unimi.dsi.fastutil.floats.FloatCollection, it.unimi.dsi.fastutil.floats.FloatIterable, FloatSet, Serializable, Cloneable, Iterable<Float>, Collection<Float>, Set<Float>
Direct Known Subclasses:
FloatSortedSets.Singleton
Enclosing class:
FloatSets

public static class FloatSets.Singleton extends AbstractFloatSet 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 float
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    boolean
    addAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
     
    boolean
    addAll(Collection<? extends Float> c)
     
     
    boolean
    contains(float k)
     
    it.unimi.dsi.fastutil.doubles.DoubleIterator
     
    it.unimi.dsi.fastutil.doubles.DoubleSpliterator
     
    void
    forEach(it.unimi.dsi.fastutil.floats.FloatConsumer action)
     
    void
    forEach(Consumer<? super Float> action)
    Deprecated.
    it.unimi.dsi.fastutil.floats.FloatListIterator
    Returns a type-specific iterator on the elements of this set.
    boolean
    remove(float k)
    Removes an element from this set.
    boolean
    removeAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
     
    boolean
     
    boolean
    removeIf(it.unimi.dsi.fastutil.floats.FloatPredicate filter)
     
    boolean
    removeIf(Predicate<? super Float> filter)
    Deprecated.
    boolean
    retainAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
     
    boolean
     
    int
     
    it.unimi.dsi.fastutil.floats.FloatSpliterator
    Returns a type-specific spliterator on the elements of this set.
    Deprecated.
    float[]
     

    Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatSet

    equals, hashCode, rem

    Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection

    add, add, contains, containsAll, containsAll, remove, toArray, toFloatArray, 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 java.util.Collection

    toArray

    Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection

    add, containsAll, doubleParallelStream, doubleStream, parallelStream, removeIf, stream, toArray, toFloatArray

    Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatIterable

    forEach

    Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatSet

    add, contains, remove

    Methods inherited from interface java.util.Set

    clear, containsAll, isEmpty, toArray
  • Field Details

    • element

      protected final float element
  • Constructor Details

    • Singleton

      protected Singleton(float element)
  • Method Details

    • contains

      public boolean contains(float k)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
    • remove

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

      public it.unimi.dsi.fastutil.floats.FloatListIterator iterator()
      Description copied from interface: FloatSet
      Returns a type-specific iterator on the elements of this set.
      Specified by:
      iterator in interface Collection<Float>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.floats.FloatIterable
      Specified by:
      iterator in interface FloatSet
      Specified by:
      iterator in interface Iterable<Float>
      Specified by:
      iterator in interface Set<Float>
      Specified by:
      iterator in class AbstractFloatSet
      Returns:
      a type-specific iterator on the elements of this set.
    • spliterator

      public it.unimi.dsi.fastutil.floats.FloatSpliterator spliterator()
      Description copied from interface: FloatSet
      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<Float>
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.floats.FloatIterable
      Specified by:
      spliterator in interface FloatSet
      Specified by:
      spliterator in interface Iterable<Float>
      Specified by:
      spliterator in interface Set<Float>
      Returns:
    • size

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

      public float[] toFloatArray()
      Specified by:
      toFloatArray in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      toFloatArray in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
    • forEach

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

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

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

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

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

      public void forEach(it.unimi.dsi.fastutil.floats.FloatConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.floats.FloatIterable
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
    • removeAll

      public boolean removeAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
      Specified by:
      removeAll in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
    • retainAll

      public boolean retainAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
      Specified by:
      retainAll in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
    • removeIf

      public boolean removeIf(it.unimi.dsi.fastutil.floats.FloatPredicate filter)
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.floats.FloatCollection
    • doubleIterator

      public it.unimi.dsi.fastutil.doubles.DoubleIterator doubleIterator()
      Specified by:
      doubleIterator in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Specified by:
      doubleIterator in interface it.unimi.dsi.fastutil.floats.FloatIterable
    • doubleSpliterator

      public it.unimi.dsi.fastutil.doubles.DoubleSpliterator doubleSpliterator()
      Specified by:
      doubleSpliterator in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Specified by:
      doubleSpliterator in interface it.unimi.dsi.fastutil.floats.FloatIterable
    • toArray

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

      public Object clone()
      Overrides:
      clone in class Object