#include <coherence/util/TreeSet.hpp>
Inherits MappedSet, and SortedSet.
The elements are ordered using their natural ordering, or by a Comparator provided at set creation time, depending on which constructor is used.
Public Types | ||||||||||||||||
typedef spec::Handle | Handle | |||||||||||||||
TreeSet Handle definition. | ||||||||||||||||
typedef spec::View | View | |||||||||||||||
TreeSet View definition. | ||||||||||||||||
typedef spec::Holder | Holder | |||||||||||||||
TreeSet Holder definition. | ||||||||||||||||
Public Member Functions | ||||||||||||||||
virtual Comparator::View | comparator () const | |||||||||||||||
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) | |||||||||||||||
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.
| ||||||||||||||||
virtual SortedSet::View | subSet (Object::View vFromElement, Object::View vToElement) const | |||||||||||||||
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) | |||||||||||||||
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.
| ||||||||||||||||
virtual SortedSet::View | headSet (Object::View vToElement) const | |||||||||||||||
Returns a view of the portion of the set strictly less than vToElement.
| ||||||||||||||||
virtual SortedSet::Handle | tailSet (Object::View vFromElement) | |||||||||||||||
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.
| ||||||||||||||||
virtual SortedSet::View | tailSet (Object::View vFromElement) const | |||||||||||||||
Returns a view of the portion of the set greater than or equal to vFromElement.
| ||||||||||||||||
virtual Object::View | first () const | |||||||||||||||
Returns the first (lowest sorted) element in the set.
| ||||||||||||||||
virtual Object::View | last () const | |||||||||||||||
Returns the last (highest sorted) element in the set.
| ||||||||||||||||
Protected Member Functions | ||||||||||||||||
TreeSet () | ||||||||||||||||
Return a new TreeSet that will sort it's elements using their natural ordering. | ||||||||||||||||
TreeSet (Comparator::View vComparator) | ||||||||||||||||
Return a new TreeSet that will sort it's elements using the supplied Comparator. | ||||||||||||||||
TreeSet (SortedMap::Handle hMap) | ||||||||||||||||
Return a TreeSet backed by the given SortedMap. | ||||||||||||||||
TreeSet (SortedMap::View vMap) | ||||||||||||||||
Return a TreeSet backed by the given SortedMap. | ||||||||||||||||
TreeSet (const TreeSet &that) | ||||||||||||||||
Copy constructor. | ||||||||||||||||
virtual void | ensureMap () | |||||||||||||||
Throws an exception iff the internal map is inaccessible. | ||||||||||||||||
virtual SortedMap::Handle | getSortedMap () | |||||||||||||||
Return the delegate SortedMap. | ||||||||||||||||
virtual SortedMap::View | getSortedMap () const | |||||||||||||||
Return the delegate SortedMap. |
TreeSet | ( | Comparator::View | vComparator | ) | [protected] |
Return a new TreeSet that will sort it's elements using the supplied Comparator.
vComparator | the Comparator used to sort elements |
TreeSet | ( | SortedMap::Handle | hMap | ) | [protected] |
TreeSet | ( | SortedMap::View | vMap | ) | [protected] |
virtual void ensureMap | ( | ) | [protected, virtual] |
Throws an exception iff the internal map is inaccessible.
IllegalStateException | iff the internal map is inaccessible |
virtual SortedMap::Handle getSortedMap | ( | ) | [protected, virtual] |
virtual SortedMap::View getSortedMap | ( | ) | const [protected, virtual] |