Oracle Coherence for C++ API
Release 3.7.0.0

E18684-01

SortedMap Class Reference

#include <coherence/util/SortedMap.hpp>

Inherits Map.

Inherited by TreeMap [virtual].

List of all members.


Detailed Description

An interface for a map which guarantees its key's iteration order.

See also:
Map

TreeMap

Author:
tb 2009.02.13

Public Types

typedef spec::Handle Handle
 SortedMap Handle definition.
typedef spec::View View
 SortedMap View definition.
typedef spec::Holder Holder
 SortedMap Holder definition.

Public Member Functions

virtual Comparator::View comparator () const =0
 Returns the comparator used in sorting this map, or NULL if it is the keys' natural ordering.
virtual Object::View firstKey () const =0
 Returns the first (lowest sorted) key in the map.
virtual Object::View lastKey () const =0
 Returns the last (highest sorted) key in the map.
virtual SortedMap::Handle headMap (Object::View vToKey)=0
 Returns a handle of the portion of the map strictly less than toKey.
virtual SortedMap::View headMap (Object::View vToKey) const =0
 Returns a view of the portion of the map strictly less than toKey.
virtual SortedMap::Handle subMap (Object::View vFromKey, Object::View vToKey)=0
 Returns a handle of the portion of the map greater than or equal to fromKey, and strictly less than toKey.
virtual SortedMap::View subMap (Object::View vFromKey, Object::View vToKey) const =0
 Returns a view of the portion of the map greater than or equal to fromKey, and strictly less than toKey.
virtual SortedMap::Handle tailMap (Object::View vFromKey)=0
 Returns a handle of the portion of the map greater than or equal to fromKey.
virtual SortedMap::View tailMap (Object::View vFromKey) const =0
 Returns a view of the portion of the map greater than or equal to fromKey.

Member Function Documentation

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

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

Returns:
the sorting comparator

Implemented in TreeMap.

virtual Object::View firstKey (  )  const [pure virtual]

Returns the first (lowest sorted) key in the map.

Returns:
the first key
Exceptions:
NoSuchElementException if this map is empty.

Implemented in TreeMap.

virtual Object::View lastKey (  )  const [pure virtual]

Returns the last (highest sorted) key in the map.

Returns:
the last key
Exceptions:
NoSuchElementException if this map is empty.

Implemented in TreeMap.

virtual SortedMap::Handle headMap ( Object::View  vToKey  )  [pure virtual]

Returns a handle of the portion of the map strictly less than toKey.

The handle is backed by this map, so changes in one show up in the other. The sub-map supports all optional operations of the original.

Parameters:
vToKey the exclusive upper range of the sub-map
Returns:
the sub-map
Exceptions:
ClassCastException if toKey is not comparable to the map contents
IllegalArgumentException if this is a subMap, and toKey is out of range
NullPointerException if toKey is NULL but the map does not allow NULL keys

Implemented in TreeMap.

virtual SortedMap::View headMap ( Object::View  vToKey  )  const [pure virtual]

Returns a view of the portion of the map strictly less than toKey.

Parameters:
vToKey the exclusive upper range of the sub-map
Returns:
the sub-map
Exceptions:
ClassCastException if toKey is not comparable to the map contents
IllegalArgumentException if this is a subMap, and toKey is out of range
NullPointerException if toKey is NULL but the map does not allow NULL keys

Implemented in TreeMap.

virtual SortedMap::Handle subMap ( Object::View  vFromKey,
Object::View  vToKey 
) [pure virtual]

Returns a handle of the portion of the map greater than or equal to fromKey, and strictly less than toKey.

The handle is backed by this map, so changes in one show up in the other. The sub-map supports all optional operations of the original.

Parameters:
vFromKey the inclusive lower range of the sub-map
vToKey the exclusive upper range of the sub-map
Returns:
the sub-map
Exceptions:
ClassCastException if fromKey or toKey is not comparable to the map contents
IllegalArgumentException if this is a subMap, and fromKey or toKey is out of range
NullPointerException if fromKey or toKey is NULL but the map does not allow NULL keys

Implemented in TreeMap.

virtual SortedMap::View subMap ( Object::View  vFromKey,
Object::View  vToKey 
) const [pure virtual]

Returns a view of the portion of the map greater than or equal to fromKey, and strictly less than toKey.

Parameters:
vFromKey the inclusive lower range of the sub-map
vToKey the exclusive upper range of the sub-map
Returns:
the sub-map
Exceptions:
ClassCastException if fromKey or toKey is not comparable to the map contents
IllegalArgumentException if this is a subMap, and fromKey or toKey is out of range
NullPointerException if fromKey or toKey is NULL but the map does not allow NULL keys

Implemented in TreeMap.

virtual SortedMap::Handle tailMap ( Object::View  vFromKey  )  [pure virtual]

Returns a handle of the portion of the map greater than or equal to fromKey.

The handle is backed by this map, so changes in one show up in the other. The sub-map supports all optional operations of the original.

Parameters:
vFromKey the inclusive lower range of the sub-map
Returns:
the sub-map
Exceptions:
ClassCastException if fromKey is not comparable to the map contents
IllegalArgumentException if this is a subMap, and fromKey is out of range
NullPointerException if fromKey is NULL but the map does not allow NULL keys

Implemented in TreeMap.

virtual SortedMap::View tailMap ( Object::View  vFromKey  )  const [pure virtual]

Returns a view of the portion of the map greater than or equal to fromKey.

Parameters:
vFromKey the inclusive lower range of the sub-map
Returns:
the sub-map
Exceptions:
ClassCastException if fromKey is not comparable to the map contents
IllegalArgumentException if this is a subMap, and fromKey is out of range
NullPointerException if fromKey is NULL but the map does not allow NULL keys

Implemented in TreeMap.


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