#include <coherence/util/SortedSet.hpp>
Inherits Set.
Inherited by TreeSet [virtual]
.
The elements are ordered using their Comparable natural ordering, or by a Comparator typically provided at sorted set creation time. The set's iterator will traverse the set in ascending element order. Several additional operations are provided to take advantage of the ordering. (This interface is the set analogue of SortedMap.)
Public Types | |
typedef spec::Handle | Handle |
SortedSet Handle definition. | |
typedef spec::View | View |
SortedSet View definition. | |
typedef spec::Holder | Holder |
SortedSet Holder definition. | |
Public Member Functions | |
virtual Comparator::View | comparator () const =0 |
Returns the comparator used in sorting this set, or NULL if it is the keys' natural ordering. | |
virtual SortedSet::Handle | subSet (Object::View vFromElement, Object::View vToElement)=0 |
Returns a handle of the portion of the set greater than or equal to vFromElement, and strictly less than vToElement. | |
virtual SortedSet::View | subSet (Object::View vFromElement, Object::View vToElement) const =0 |
Returns a view of the portion of the set greater than or equal to vFromElement, and strictly less than vToElement. | |
virtual SortedSet::Handle | headSet (Object::View vToElement)=0 |
Returns a handle of the portion of the set strictly less than vToElement. | |
virtual SortedSet::View | headSet (Object::View vToElement) const =0 |
Returns a view of the portion of the set strictly less than vToElement. | |
virtual SortedSet::Handle | tailSet (Object::View vFromElement)=0 |
Returns a handle of the portion of the set greater than or equal to vFromElement. | |
virtual SortedSet::View | tailSet (Object::View vFromElement) const =0 |
Returns a view of the portion of the set greater than or equal to vFromElement. | |
virtual Object::View | first () const =0 |
Returns the first (lowest sorted) element in the set. | |
virtual Object::View | last () const =0 |
Returns the last (highest sorted) element in the set. |
virtual Comparator::View comparator | ( | ) | const [pure virtual] |
Returns the comparator used in sorting this set, or NULL if it is the keys' natural ordering.
Implemented in TreeSet.
virtual SortedSet::Handle subSet | ( | Object::View | vFromElement, | |
Object::View | vToElement | |||
) | [pure virtual] |
Returns a handle of the portion of the set greater than or equal to vFromElement, and strictly less than vToElement.
The handle is backed by this set, so changes in one show up in the other.
vFromElement | the inclusive lower range of the sub-set | |
vToElement | the exclusive upper range of the sub-set |
ClassCastException | if vFromElement or vToElement is not comparable to the set's contents | |
IllegalArgumentException | if this is a sub-set, and vFromElement or or vToElement is out of range | |
NullPointerException | if vFromElement or vToElement is NULL but the map does not allow NULL elements |
Implemented in TreeSet.
virtual SortedSet::View subSet | ( | Object::View | vFromElement, | |
Object::View | vToElement | |||
) | const [pure virtual] |
Returns a view of the portion of the set greater than or equal to vFromElement, and strictly less than vToElement.
vFromElement | the inclusive lower range of the sub-set | |
vToElement | the exclusive upper range of the sub-set |
ClassCastException | if vFromElement or vToElement is not comparable to the set's contents | |
IllegalArgumentException | if this is a sub-set, and vFromElement or vToElement is out of range | |
NullPointerException | if vFromElement or vToElement is NULL but the set does not allow NULL elements |
Implemented in TreeSet.
virtual SortedSet::Handle headSet | ( | Object::View | vToElement | ) | [pure virtual] |
Returns a handle of the portion of the set strictly less than vToElement.
The handle is backed by this set, so changes in one show up in the other. The sub-set supports all optional operations of the original.
vToElement | the exclusive upper range of the sub-set |
ClassCastException | if vToElement is not comparable to the set contents | |
IllegalArgumentException | if this is a sub-set, and vToElement is out of range | |
NullPointerException | if vToElement is NULL but the set does not allow NULL elements |
Implemented in TreeSet.
virtual SortedSet::View headSet | ( | Object::View | vToElement | ) | const [pure virtual] |
Returns a view of the portion of the set strictly less than vToElement.
vToElement | the exclusive upper range of the sub-set |
ClassCastException | if vToElement is not comparable to the set contents | |
IllegalArgumentException | if this is a sub-set, and vToElement is out of range | |
NullPointerException | if vToElement is NULL but the set does not allow NULL elements |
Implemented in TreeSet.
virtual SortedSet::Handle tailSet | ( | Object::View | vFromElement | ) | [pure virtual] |
Returns a handle of the portion of the set greater than or equal to vFromElement.
The handle is backed by this set, so changes in one show up in the other. The sub-set supports all optional operations of the original.
vFromElement | the inclusive lower range of the sub-set |
ClassCastException | if vFromElement is not comparable to the set contents | |
IllegalArgumentException | if this is a sub-set, and vFromElement is out of range | |
NullPointerException | if vFromElement is NULL but the set does not allow NULL elements |
Implemented in TreeSet.
virtual SortedSet::View tailSet | ( | Object::View | vFromElement | ) | const [pure virtual] |
Returns a view of the portion of the set greater than or equal to vFromElement.
vFromElement | the inclusive lower range of the sub-set |
ClassCastException | if vFromElement is not comparable to the set contents | |
IllegalArgumentException | if this is a sub-set, and vFromElement is out of range | |
NullPointerException | if vFromElement is NULL but the set does not allow NULL elements |
Implemented in TreeSet.
virtual Object::View first | ( | ) | const [pure virtual] |
Returns the first (lowest sorted) element in the set.
NoSuchElementException | if this set is empty. |
Implemented in TreeSet.
virtual Object::View last | ( | ) | const [pure virtual] |
Returns the last (highest sorted) element in the set.
NoSuchElementException | if this set is empty. |
Implemented in TreeSet.