Known Indirect Subclasses
|
Class Overview
SortedSet is a Set which iterates over its elements in a sorted order. The
order is determined either by the elements natural ordering, or by a
Comparator
which is passed into a concrete implementation at
construction time. All elements in this set must be mutually comparable. The
ordering in this set must be consistent with equals
of its elements.
Summary
Public Methods |
abstract
Comparator<? super E>
|
comparator()
Returns the comparator used to compare elements in this SortedSet .
|
abstract
E
|
first()
Returns the first element in this SortedSet .
|
abstract
SortedSet<E>
|
headSet(E end)
Returns a SortedSet of the specified portion of this
SortedSet which contains elements less than the end element.
|
abstract
E
|
last()
Returns the last element in this SortedSet .
|
abstract
SortedSet<E>
|
subSet(E start, E end)
Returns a SortedSet of the specified portion of this
SortedSet which contains elements greater or equal to the start
element but less than the end element.
|
abstract
SortedSet<E>
|
tailSet(E start)
Returns a SortedSet of the specified portion of this
SortedSet which contains elements greater or equal to the start
element.
|
[Expand]
Inherited Methods |
From interface
java.lang.Iterable
|
From interface
java.util.Collection
abstract
boolean
|
add(E object)
Attempts to add object to the contents of this
Collection (optional).
|
abstract
boolean
|
addAll(Collection<? extends E> collection)
Attempts to add all of the objects contained in Collection
to the contents of this Collection (optional).
|
abstract
void
|
clear()
Removes all elements from this Collection , leaving it empty (optional).
|
abstract
boolean
|
contains(Object object)
Tests whether this Collection contains the specified object.
|
abstract
boolean
|
containsAll(Collection<?> collection)
Tests whether this Collection contains all objects contained in the
specified Collection .
|
abstract
boolean
|
equals(Object object)
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
|
abstract
int
|
hashCode()
Returns an integer hash code for the receiver.
|
abstract
boolean
|
isEmpty()
Returns if this Collection contains no elements.
|
abstract
Iterator<E>
|
iterator()
Returns an instance of Iterator that may be used to access the
objects contained by this Collection .
|
abstract
boolean
|
remove(Object object)
Removes one instance of the specified object from this Collection if one
is contained (optional).
|
abstract
boolean
|
removeAll(Collection<?> collection)
Removes all occurrences in this Collection of each object in the
specified Collection (optional).
|
abstract
boolean
|
retainAll(Collection<?> collection)
Removes all objects from this Collection that are not also found in the
Collection passed (optional).
|
abstract
int
|
size()
Returns a count of how many objects this Collection contains.
|
abstract
<T>
T[]
|
toArray(T[] array)
Returns an array containing all elements contained in this Collection .
|
abstract
Object[]
|
toArray()
Returns a new array containing all elements contained in this Collection .
|
|
From interface
java.util.Set
abstract
boolean
|
add(E object)
Adds the specified object to this set.
|
abstract
boolean
|
addAll(Collection<? extends E> collection)
Adds the objects in the specified collection which do not exist yet in
this set.
|
abstract
void
|
clear()
Removes all elements from this set, leaving it empty.
|
abstract
boolean
|
contains(Object object)
Searches this set for the specified object.
|
abstract
boolean
|
containsAll(Collection<?> collection)
Searches this set for all objects in the specified collection.
|
abstract
boolean
|
equals(Object object)
Compares the specified object to this set, and returns true if they
represent the same object using a class specific comparison.
|
abstract
int
|
hashCode()
Returns the hash code for this set.
|
abstract
boolean
|
isEmpty()
Returns true if this set has no elements.
|
abstract
Iterator<E>
|
iterator()
Returns an iterator on the elements of this set.
|
abstract
boolean
|
remove(Object object)
Removes the specified object from this set.
|
abstract
boolean
|
removeAll(Collection<?> collection)
Removes all objects in the specified collection from this set.
|
abstract
boolean
|
retainAll(Collection<?> collection)
Removes all objects from this set that are not contained in the specified
collection.
|
abstract
int
|
size()
Returns the number of elements in this set.
|
abstract
<T>
T[]
|
toArray(T[] array)
Returns an array containing all elements contained in this set.
|
abstract
Object[]
|
toArray()
Returns an array containing all elements contained in this set.
|
|
Public Methods
public
abstract
Comparator<? super E>
comparator
()
Returns the comparator used to compare elements in this SortedSet
.
Returns
- a comparator or null if the natural ordering is used.
public
abstract
E
first
()
Returns the first element in this SortedSet
. The first element
is the lowest element.
public
abstract
SortedSet<E>
headSet
(E end)
Returns a SortedSet
of the specified portion of this
SortedSet
which contains elements less than the end element. The
returned SortedSet
is backed by this SortedSet
so changes
to one set are reflected by the other.
Returns
- a subset where the elements are less than
end
.
public
abstract
E
last
()
Returns the last element in this SortedSet
. The last element is
the highest element.
public
abstract
SortedSet<E>
subSet
(E start, E end)
Returns a SortedSet
of the specified portion of this
SortedSet
which contains elements greater or equal to the start
element but less than the end element. The returned SortedSet
is
backed by this SortedMap so changes to one set are reflected by the
other.
Parameters
start
| the start element. |
end
| the end element. |
Returns
- a subset where the elements are greater or equal to
start
and less than end
.
public
abstract
SortedSet<E>
tailSet
(E start)
Returns a SortedSet
of the specified portion of this
SortedSet
which contains elements greater or equal to the start
element. The returned SortedSet
is backed by this
SortedSet
so changes to one set are reflected by the other.
Returns
- a subset where the elements are greater or equal to
start
.
Throws
ClassCastException
| when the class of the start element is inappropriate for this
SubSet. |
NullPointerException
| when the start element is null and this SortedSet
does not support null elements.
|