it.unimi.dsi.fastutil.doubles
Class DoubleSortedSets.EmptySet

java.lang.Object
  extended by java.util.AbstractCollection<Double>
      extended by it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
          extended by it.unimi.dsi.fastutil.doubles.DoubleCollections.EmptyCollection
              extended by it.unimi.dsi.fastutil.doubles.DoubleSets.EmptySet
                  extended by it.unimi.dsi.fastutil.doubles.DoubleSortedSets.EmptySet
All Implemented Interfaces:
DoubleCollection, DoubleIterable, DoubleSet, DoubleSortedSet, Serializable, Cloneable, Iterable<Double>, Collection<Double>, Set<Double>, SortedSet<Double>
Enclosing class:
DoubleSortedSets

public static class DoubleSortedSets.EmptySet
extends DoubleSets.EmptySet
implements DoubleSortedSet, Serializable, Cloneable

An immutable class representing the empty sorted set and implementing a type-specific set interface.

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

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 Object clone()
           
 DoubleComparator comparator()
          Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
 DoubleBidirectionalIterator doubleIterator()
          Deprecated. 
 Double first()
           
 double firstDouble()
           
 DoubleSortedSet headSet(double from)
           
 DoubleSortedSet headSet(Double from)
          Returns a view of the portion of this sorted set whose elements are strictly less than toElement.
 DoubleBidirectionalIterator iterator(double from)
          Returns a type-specific BidirectionalIterator on the elements in this set, starting from a given element of the domain (optional operation).
 Double last()
           
 double lastDouble()
           
 boolean remove(double ok)
          Removes an element from this set.
 DoubleSortedSet subSet(double from, double to)
           
 DoubleSortedSet subSet(Double from, Double to)
          Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.
 DoubleSortedSet tailSet(double to)
           
 DoubleSortedSet tailSet(Double to)
          Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement.
 
Methods inherited from class it.unimi.dsi.fastutil.doubles.DoubleCollections.EmptyCollection
add, addAll, clear, contains, containsAll, equals, hashCode, iterator, rem, removeAll, retainAll, size, toArray, toDoubleArray, toDoubleArray
 
Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
add, addAll, contains, containsAll, isEmpty, rem, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleSortedSet
iterator
 
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection
add, addAll, contains, containsAll, rem, removeAll, retainAll, toArray, toArray, toDoubleArray, toDoubleArray
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

remove

public boolean remove(double ok)
Description copied from interface: DoubleSet
Removes an element from this set.

Note that the corresponding method of the type-specific collection is rem(). This unfortunate situation is caused by the clash with the similarly named index-based method in the List interface.

Specified by:
remove in interface DoubleSet
Overrides:
remove in class DoubleSets.EmptySet
See Also:
Collection.remove(Object)

doubleIterator

@Deprecated
public DoubleBidirectionalIterator doubleIterator()
Deprecated. 

Description copied from class: AbstractDoubleCollection
Delegates to the new covariantly stronger generic method.

Specified by:
doubleIterator in interface DoubleCollection
Specified by:
doubleIterator in interface DoubleSortedSet
Overrides:
doubleIterator in class AbstractDoubleCollection
See Also:
DoubleCollection.iterator()

iterator

public DoubleBidirectionalIterator iterator(double from)
Description copied from interface: DoubleSortedSet
Returns a type-specific BidirectionalIterator on the elements in this set, starting from a given element of the domain (optional operation).

This method returns a type-specific bidirectional iterator with given starting point. The starting point is any element comparable to the elements of this set (even if it does not actually belong to the set). The next element of the returned iterator is the least element of the set that is greater than the starting point (if there are no elements greater than the starting point, hasNext() will return false). The previous element of the returned iterator is the greatest element of the set that is smaller than or equal to the starting point (if there are no elements smaller than or equal to the starting point, hasPrevious() will return false).

Note that passing the last element of the set as starting point and calling previous() you can traverse the entire set in reverse order.

Specified by:
iterator in interface DoubleSortedSet
Parameters:
from - an element to start from.
Returns:
a bidirectional iterator on the element in this set, starting at the given element.

subSet

public DoubleSortedSet subSet(double from,
                              double to)
Specified by:
subSet in interface DoubleSortedSet
See Also:
SortedSet.subSet(Object,Object)

headSet

public DoubleSortedSet headSet(double from)
Specified by:
headSet in interface DoubleSortedSet
See Also:
SortedSet.headSet(Object)

tailSet

public DoubleSortedSet tailSet(double to)
Specified by:
tailSet in interface DoubleSortedSet
See Also:
SortedSet.tailSet(Object)

firstDouble

public double firstDouble()
Specified by:
firstDouble in interface DoubleSortedSet
See Also:
SortedSet.first()

lastDouble

public double lastDouble()
Specified by:
lastDouble in interface DoubleSortedSet
See Also:
SortedSet.last()

comparator

public DoubleComparator comparator()
Description copied from interface: DoubleSortedSet
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

Note that this specification strengthens the one given in SortedSet.comparator().

Specified by:
comparator in interface DoubleSortedSet
Specified by:
comparator in interface SortedSet<Double>
See Also:
SortedSet.comparator()

subSet

public DoubleSortedSet subSet(Double from,
                              Double to)
Description copied from interface: DoubleSortedSet
Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.

Note that this specification strengthens the one given in SortedSet.subSet(Object,Object).

Specified by:
subSet in interface DoubleSortedSet
Specified by:
subSet in interface SortedSet<Double>
See Also:
SortedSet.subSet(Object,Object)

headSet

public DoubleSortedSet headSet(Double from)
Description copied from interface: DoubleSortedSet
Returns a view of the portion of this sorted set whose elements are strictly less than toElement.

Note that this specification strengthens the one given in SortedSet.headSet(Object).

Specified by:
headSet in interface DoubleSortedSet
Specified by:
headSet in interface SortedSet<Double>
See Also:
SortedSet.headSet(Object)

tailSet

public DoubleSortedSet tailSet(Double to)
Description copied from interface: DoubleSortedSet
Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement.

Note that this specification strengthens the one given in SortedSet.tailSet(Object).

Specified by:
tailSet in interface DoubleSortedSet
Specified by:
tailSet in interface SortedSet<Double>
See Also:
SortedSet.tailSet(Object)

first

public Double first()
Specified by:
first in interface SortedSet<Double>

last

public Double last()
Specified by:
last in interface SortedSet<Double>

clone

public Object clone()
Overrides:
clone in class DoubleSets.EmptySet