PCJ API
Version 1.2

bak.pcj.set
Interface DoubleSortedSet

All Superinterfaces:
DoubleCollection, DoubleSet
All Known Implementing Classes:
SortedSetToDoubleSortedSetAdapter

public interface DoubleSortedSet
extends DoubleSet

This interface defines extends the DoubleSet interface to define sorted sets.

Since:
1.2
See Also:
SortedSet

Method Summary
 boolean add(double v)
          Adds an element to this set.
 double first()
          Returns the lowest element of this set.
 DoubleSortedSet headSet(double to)
          Returns the subset of values lower than a specified value.
 double last()
          Returns the highest element of this set.
 DoubleSortedSet subSet(double from, double to)
          Returns the subset of values lower that a specified value and higher than or equal to another specified value.
 DoubleSortedSet tailSet(double from)
          Returns the subset of values higher than or equal to a specified value.
 
Methods inherited from interface bak.pcj.DoubleCollection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, trimToSize
 

Method Detail

add

public boolean add(double v)
Adds an element to this set.

Specified by:
add in interface DoubleCollection
Parameters:
v - the element to add to this set.
Returns:
true if this set was modified as a result of adding v; returns false otherwise.
Throws:
UnsupportedOperationException - if the operation is not supported by this set.
IllegalArgumentException - if v is not permitted, because this set is a subset of another set.
See Also:
DoubleCollection.addAll(DoubleCollection)

first

public double first()
Returns the lowest element of this set.

Returns:
the lowest element of this set.
Throws:
NoSuchElementException - if this set is empty.

headSet

public DoubleSortedSet headSet(double to)
Returns the subset of values lower than a specified value. The returned subset is a view of this set, so changes to the subset are reflected by this set and vice versa.

Parameters:
to - the upper bound of the returned set (not included).
Throws:
IllegalArgumentException - if to is not permitted in this set (which can be the case with returned subsets).

last

public double last()
Returns the highest element of this set.

Returns:
the highest element of this set.
Throws:
NoSuchElementException - if this set is empty.

subSet

public DoubleSortedSet subSet(double from,
                              double to)
Returns the subset of values lower that a specified value and higher than or equal to another specified value. The returned subset is a view of this set, so changes to the subset are reflected by this set and vice versa.

Parameters:
from - the lower bound of the returned set (included).
to - the upper bound of the returned set (not included).
Throws:
IllegalArgumentException - if from is greater than to; if from or to is not permitted in this set (which can be the case with returned subsets).

tailSet

public DoubleSortedSet tailSet(double from)
Returns the subset of values higher than or equal to a specified value. The returned subset is a view of this set, so changes to the subset are reflected by this set and vice versa.

Parameters:
from - the lower bound of the returned set (included).
Throws:
IllegalArgumentException - if from is not permitted in this set (which can be the case with returned subsets).

PCJ API
Version 1.2

Report a bug or request a feature.
Further information on the development and latest release of PCJ can be found at the project homepage.

Primitive Collections for Java is released under the GNU Lesser General Public License.
Copyright © 2002, 2003 Søren Bak. All Rights Reserved.

Hosted by SourceForge.net
SourceForge.net Logo