Class DoubleSets.Singleton

java.lang.Object
java.util.AbstractCollection<Double>
it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
it.unimi.dsi.fastutil.doubles.AbstractDoubleSet
it.unimi.dsi.fastutil.doubles.DoubleSets.Singleton
All Implemented Interfaces:
it.unimi.dsi.fastutil.doubles.DoubleCollection, it.unimi.dsi.fastutil.doubles.DoubleIterable, DoubleSet, Serializable, Cloneable, Iterable<Double>, Collection<Double>, Set<Double>
Direct Known Subclasses:
DoubleSortedSets.Singleton
Enclosing class:
DoubleSets

public static class DoubleSets.Singleton extends AbstractDoubleSet 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 double
     
  • Constructor Summary

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

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

    Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleSet

    equals, hashCode, rem

    Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection

    add, add, contains, containsAll, containsAll, forEach, remove, removeIf, toArray, toDoubleArray, 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.doubles.DoubleCollection

    add, containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, removeIf, stream, toArray, toDoubleArray

    Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterable

    forEach

    Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleSet

    add, contains, remove

    Methods inherited from interface java.util.Set

    clear, containsAll, isEmpty, toArray
  • Field Details

    • element

      protected final double element
  • Constructor Details

    • Singleton

      protected Singleton(double element)
  • Method Details

    • contains

      public boolean contains(double k)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • remove

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

      public it.unimi.dsi.fastutil.doubles.DoubleListIterator iterator()
      Description copied from interface: DoubleSet
      Returns a type-specific iterator on the elements of this set.
      Specified by:
      iterator in interface Collection<Double>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.doubles.DoubleIterable
      Specified by:
      iterator in interface DoubleSet
      Specified by:
      iterator in interface Iterable<Double>
      Specified by:
      iterator in interface Set<Double>
      Specified by:
      iterator in class AbstractDoubleSet
      Returns:
      a type-specific iterator on the elements of this set.
    • spliterator

      public it.unimi.dsi.fastutil.doubles.DoubleSpliterator spliterator()
      Description copied from interface: DoubleSet
      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<Double>
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.doubles.DoubleIterable
      Specified by:
      spliterator in interface DoubleSet
      Specified by:
      spliterator in interface Iterable<Double>
      Specified by:
      spliterator in interface Set<Double>
      Returns:
    • size

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

      public double[] toDoubleArray()
      Specified by:
      toDoubleArray in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      toDoubleArray in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • forEach

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

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

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

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

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

      public void forEach(DoubleConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.doubles.DoubleIterable
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.doubles.DoubleCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • removeAll

      public boolean removeAll(it.unimi.dsi.fastutil.doubles.DoubleCollection c)
      Specified by:
      removeAll in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • retainAll

      public boolean retainAll(it.unimi.dsi.fastutil.doubles.DoubleCollection c)
      Specified by:
      retainAll in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • removeIf

      public boolean removeIf(DoublePredicate filter)
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
    • toArray

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

      public Object clone()
      Overrides:
      clone in class Object