Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

SortedSet Class Reference

#include <coherence/util/SortedSet.hpp>

Inherits Set.

Inherited by TreeSet [virtual].

List of all members.


Detailed Description

A Set that further provides a total ordering on its elements.

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.)

See also:
Set

TreeSet

TreeMap

Author:
hr 2011.09.07
Since:
Coherence 12.1.2

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.

Member Function Documentation

virtual Comparator::View comparator (  )  const [pure virtual]

Returns the comparator used in sorting this set, or NULL if it is the keys' natural ordering.

Returns:
the sorting comparator

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.

Parameters:
vFromElement the inclusive lower range of the sub-set
vToElement the exclusive upper range of the sub-set
Returns:
the sub-set
Exceptions:
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.

Parameters:
vFromElement the inclusive lower range of the sub-set
vToElement the exclusive upper range of the sub-set
Returns:
the sub-set
Exceptions:
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.

Parameters:
vToElement the exclusive upper range of the sub-set
Returns:
the sub-set
Exceptions:
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.

Parameters:
vToElement the exclusive upper range of the sub-set
Returns:
the sub-set
Exceptions:
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.

Parameters:
vFromElement the inclusive lower range of the sub-set
Returns:
the sub-set
Exceptions:
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.

Parameters:
vFromElement the inclusive lower range of the sub-set
Returns:
the sub-set
Exceptions:
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.

Returns:
the first element
Exceptions:
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.

Returns:
the last element
Exceptions:
NoSuchElementException if this set is empty.

Implemented in TreeSet.


The documentation for this class was generated from the following file:
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.