Known Indirect Subclasses
| TreeSet<E> |
TreeSet is an implementation of SortedSet. |
|
Class Overview
SortedSet is a Set which iterates its elements in sorted order.
Summary
| Public Methods |
|
abstract
Comparator<? super E>
|
comparator()
Returns the Comparator used to compare elements in this SortedSet.
|
|
abstract
E
|
first()
Answer the first sorted 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()
Answer the last sorted 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.
|
|
abstract
boolean
|
addAll(Collection<? extends E> collection)
Attempts to add all of the objects contained in collection
to the contents of this collection.
|
|
abstract
void
|
clear()
Removes all elements from this Collection, leaving it empty.
|
|
abstract
boolean
|
contains(Object object)
Searches this Collection for the specified object.
|
|
abstract
boolean
|
containsAll(Collection<?> collection)
Searches this Collection for all objects 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 has no elements, a size of zero.
|
|
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 the first occurrence of the specified object from this
Collection.
|
|
abstract
boolean
|
removeAll(Collection<?> collection)
Removes all occurrences in this Collection of each object in the
specified Collection.
|
|
abstract
boolean
|
retainAll(Collection<?> collection)
Removes all objects from this Collection that are not also found in the
contents of collection.
|
|
abstract
int
|
size()
Returns a count of how many objects are contained by this collection.
|
|
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 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 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 Set has no elements, a size of zero.
|
|
abstract
Iterator<E>
|
iterator()
Returns an Iterator on the elements of this Set.
|
|
abstract
boolean
|
remove(Object object)
Removes any occurrence of 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 order is used
public
abstract
E
first
()
Answer the first sorted element in this SortedSet.
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 are reflected by the other.
Returns
- a subset where the elements are less than
end
public
abstract
E
last
()
Answer the last sorted element in this SortedSet.
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 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 are reflected by
the other.
Returns
- a subset where the elements are greater or equal to
start