activemq-cpp-3.6.0
decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR > Class Template Reference

Map template that wraps around a std::map to provide a more user-friendly interface and to provide common functions that do not exist in std::map. More...

#include <src/main/decaf/util/concurrent/ConcurrentStlMap.h>

Inheritance diagram for decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >:

Data Structures

class  AbstractMapIterator
class  ConstAbstractMapIterator
class  ConstEntryIterator
class  ConstKeyIterator
class  ConstStlMapEntrySet
class  ConstStlMapKeySet
class  ConstStlMapValueCollection
class  ConstValueIterator
class  EntryIterator
class  KeyIterator
class  StlMapEntrySet
class  StlMapKeySet
class  StlMapValueCollection
class  ValueIterator

Public Member Functions

 ConcurrentStlMap ()
 Default constructor - does nothing.
 ConcurrentStlMap (const ConcurrentStlMap &source)
 Copy constructor - copies the content of the given map into this one.
 ConcurrentStlMap (const Map< K, V > &source)
 Copy constructor - copies the content of the given map into this one.
virtual ~ConcurrentStlMap ()
virtual bool equals (const ConcurrentStlMap &source) const
 
virtual bool equals (const Map< K, V > &source) const
 Compares the specified object with this map for equality.
virtual void copy (const ConcurrentStlMap &source)
 
virtual void copy (const Map< K, V > &source)
 Copies the content of the source map into this map.
virtual void clear ()
 Removes all of the mappings from this map (optional operation).The map will be empty after this call returns.
Exceptions
UnsupportedOperationExceptionif the clear operation is not supported by this map.

virtual bool containsKey (const K &key) const
 Returns true if this map contains a mapping for the specified key.More formally, returns true if and only if this map contains a mapping for a key k such that (key == k). (There can be at most one such mapping.)
Parameters
keyThe key to look up.
Returns
true if this map contains the key mapping, otherwise false.

virtual bool containsValue (const V &value) const
 Returns true if this map maps one or more keys to the specified value.More formally, returns true if and only if this map contains at least one mapping to a value v such that (value==v). This operation will probably require time linear in the map size for most implementations of the Map interface.
Parameters
valueThe Value to look up in this Map.
Returns
true if this map contains at least one mapping for the value, otherwise false.

virtual bool isEmpty () const
 
Returns
if the Map contains any element or not, TRUE or FALSE

virtual int size () const
 
Returns
The number of elements (key/value pairs) in this map.

virtual V & get (const K &key)
 Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.
Parameters
keyThe search key whose value should be returned if present.
Returns
A reference to the value for the given key if present in the Map.
Exceptions
NoSuchElementExceptionif the key requests doesn't exist in the Map.

virtual const V & get (const K &key) const
 Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.
Parameters
keyThe search key whose value should be returned if present.
Returns
A const reference to the value for the given key if present in the Map.
Exceptions
NoSuchElementExceptionif the key requests doesn't exist in the Map.

virtual bool put (const K &key, const V &value)
 Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)
Parameters
keyThe target key.
valueThe value to be set.
Returns
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions
UnsupportedOperationExceptionif this map is unmodifiable.
IllegalArgumentExceptionif some property of the specified key or value prevents it from being stored in this map

virtual bool put (const K &key, const V &value, V &oldValue)
 Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)This method accepts a reference to a value which will be assigned the previous value for the given key (if any). If there was no previous mapping for the given key the out value is not written to. A return of true indicates that a value was replaced by this put operation.
Parameters
keyThe target key.
valueThe value to be set.
oldValue(out) The value previously held in the mapping for this key. .
Returns
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions
UnsupportedOperationExceptionif this map is unmodifiable.
IllegalArgumentExceptionif some property of the specified key or value prevents it from being stored in this map

virtual void putAll (const ConcurrentStlMap< K, V, COMPARATOR > &other)
 
virtual void putAll (const Map< K, V > &other)
 Copies all of the mappings from the specified map to this map (optional operation).The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress.
Parameters
otherA Map instance whose elements are to all be inserted in this Map.
Exceptions
UnsupportedOperationExceptionIf the implementing class does not support the putAll operation.

virtual V remove (const K &key)
 Removes the value (key/value pair) for the specified key from the map, returns a copy of the value that was mapped to the key.Care must be taken when using this operation as it will throw an exception if there is no mapping for the given key.
Parameters
keyThe search key whose mapping is to be removed.
Returns
a copy of the element that was previously mapped to the given key.
Exceptions
NoSuchElementExceptionif this key is not in the Map.
UnsupportedOperationExceptionif this map is unmodifiable.

bool putIfAbsent (const K &key, const V &value)
 If the specified key is not already associated with a value, associate it with the given value.
bool remove (const K &key, const V &value)
 Remove entry for key only if currently mapped to given value.
bool replace (const K &key, const V &oldValue, const V &newValue)
 Replace entry for key only if currently mapped to given value.
replace (const K &key, const V &value)
 Replace entry for key only if currently mapped to some value.
virtual Set< MapEntry< K, V > > & entrySet ()
 Returns a Set view of the mappings contained in this map.
virtual const Set< MapEntry< K,
V > > & 
entrySet () const
virtual Set< K > & keySet ()
 Returns a Set view of the keys contained in this map.
virtual const Set< K > & keySet () const
virtual Collection< V > & values ()
 Returns a Collection view of the values contained in this map.
virtual const Collection< V > & values () const
virtual void lock ()
 Locks the object.
virtual bool tryLock ()
 Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
virtual void unlock ()
 Unlocks the object.
virtual void wait ()
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs, int nanos)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void notify ()
 Signals a waiter on this object that it can now wake up and continue.
virtual void notifyAll ()
 Signals the waiters on this object that it can now wake up and continue.
- Public Member Functions inherited from decaf::util::concurrent::ConcurrentMap< K, V >
virtual ~ConcurrentMap ()
- Public Member Functions inherited from decaf::util::Map< K, V >
 Map ()
 Default constructor - does nothing.
virtual ~Map ()
- Public Member Functions inherited from decaf::util::concurrent::Synchronizable
virtual ~Synchronizable ()

Detailed Description

template<typename K, typename V, typename COMPARATOR = std::less<K>>
class decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >

Map template that wraps around a std::map to provide a more user-friendly interface and to provide common functions that do not exist in std::map.

This version of Map extends the ConcurrentMap inteface and implements all the methods defined in that interface. Unlike a Java ConcurrentHashMap this implementations synchronizes all methods such that any call to this class will block if another thread is already holding a lock, much like the Java HashTable.

Since
1.0

Constructor & Destructor Documentation

template<typename K, typename V, typename COMPARATOR = std::less<K>>
decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::ConcurrentStlMap ( )
inline

Default constructor - does nothing.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::ConcurrentStlMap ( const ConcurrentStlMap< K, V, COMPARATOR > &  source)
inline

Copy constructor - copies the content of the given map into this one.

Parameters
sourceThe source map.
template<typename K, typename V, typename COMPARATOR = std::less<K>>
decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::ConcurrentStlMap ( const Map< K, V > &  source)
inline

Copy constructor - copies the content of the given map into this one.

Parameters
sourceThe source map.
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::~ConcurrentStlMap ( )
inlinevirtual

Member Function Documentation

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::clear ( )
inlinevirtual

Removes all of the mappings from this map (optional operation).The map will be empty after this call returns.

Exceptions
UnsupportedOperationExceptionif the clear operation is not supported by this map.

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::copy().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::containsKey ( const K &  key) const
inlinevirtual
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::containsValue ( const V &  value) const
inlinevirtual

Returns true if this map maps one or more keys to the specified value.More formally, returns true if and only if this map contains at least one mapping to a value v such that (value==v). This operation will probably require time linear in the map size for most implementations of the Map interface.

Parameters
valueThe Value to look up in this Map.
Returns
true if this map contains at least one mapping for the value, otherwise false.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::copy ( const ConcurrentStlMap< K, V, COMPARATOR > &  source)
inlinevirtual
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::copy ( const Map< K, V > &  source)
inlinevirtual

Copies the content of the source map into this map.

Erases all existing mappings in this map. The copy is performed by using the entrySet of the source Map and iterating over those entries, inserting each into the target.

Parameters
sourceThe source object to copy from.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual Set< MapEntry<K, V> >& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::entrySet ( )
inlinevirtual

Returns a Set view of the mappings contained in this map.

The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns
a reference to a Set<MapEntry<K,V>> that is backed by this Map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const Set< MapEntry<K, V> >& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::entrySet ( ) const
inlinevirtual
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::equals ( const ConcurrentStlMap< K, V, COMPARATOR > &  source) const
inlinevirtual

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::equals ( const Map< K, V > &  source) const
inlinevirtual

Compares the specified object with this map for equality.

Returns true if the two maps represent the same mappings. More formally, two maps m1 and m2 represent the same mappings if m1.entrySet().equals(m2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.

Parameters
sourceMap to compare to this one.
Returns
true if the Map passed is equal in value to this one.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual V& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::get ( const K &  key)
inlinevirtual

Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.

Parameters
keyThe search key whose value should be returned if present.
Returns
A reference to the value for the given key if present in the Map.
Exceptions
NoSuchElementExceptionif the key requests doesn't exist in the Map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const V& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::get ( const K &  key) const
inlinevirtual

Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.

Parameters
keyThe search key whose value should be returned if present.
Returns
A const reference to the value for the given key if present in the Map.
Exceptions
NoSuchElementExceptionif the key requests doesn't exist in the Map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::isEmpty ( ) const
inlinevirtual

Returns
if the Map contains any element or not, TRUE or FALSE

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual Set<K>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::keySet ( )
inlinevirtual

Returns a Set view of the keys contained in this map.

The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns
a set view of the keys contained in this map,

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::equals().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const Set<K>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::keySet ( ) const
inlinevirtual
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::lock ( )
inlinevirtual

Locks the object.

Exceptions
RuntimeExceptionif an error occurs while locking the object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::notify ( )
inlinevirtual

Signals a waiter on this object that it can now wake up and continue.

Must have this object locked before calling.

Exceptions
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.
RuntimeExceptionif an error occurs while notifying one of the waiting threads.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::notifyAll ( )
inlinevirtual

Signals the waiters on this object that it can now wake up and continue.

Must have this object locked before calling.

Exceptions
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.
RuntimeExceptionif an error occurs while notifying the waiting threads.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::put ( const K &  key,
const V &  value 
)
inlinevirtual

Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Parameters
keyThe target key.
valueThe value to be set.
Returns
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions
UnsupportedOperationExceptionif this map is unmodifiable.
IllegalArgumentExceptionif some property of the specified key or value prevents it from being stored in this map

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::putAll(), decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::putIfAbsent(), and decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::replace().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::put ( const K &  key,
const V &  value,
V &  oldValue 
)
inlinevirtual

Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)This method accepts a reference to a value which will be assigned the previous value for the given key (if any). If there was no previous mapping for the given key the out value is not written to. A return of true indicates that a value was replaced by this put operation.

Parameters
keyThe target key.
valueThe value to be set.
oldValue(out) The value previously held in the mapping for this key. .
Returns
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions
UnsupportedOperationExceptionif this map is unmodifiable.
IllegalArgumentExceptionif some property of the specified key or value prevents it from being stored in this map

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::putAll ( const ConcurrentStlMap< K, V, COMPARATOR > &  other)
inlinevirtual
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::putAll ( const Map< K, V > &  other)
inlinevirtual

Copies all of the mappings from the specified map to this map (optional operation).The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress.

Parameters
otherA Map instance whose elements are to all be inserted in this Map.
Exceptions
UnsupportedOperationExceptionIf the implementing class does not support the putAll operation.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::putIfAbsent ( const K &  key,
const V &  value 
)
inlinevirtual

If the specified key is not already associated with a value, associate it with the given value.

This is equivalent to

    if( !map.containsKey( key ) ) {
        map.put( key, value );
        return true;
    } else {
        return false;
    }

except that the action is performed atomically.

Parameters
keyThe key to map the value to.
valueThe value to map to the given key.
Returns
true if the put operation was performed otherwise return false which indicates there was a value previously mapped to the key.
Exceptions
UnsupportedOperationExceptionif the put operation is not supported by this map

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual V decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::remove ( const K &  key)
inlinevirtual

Removes the value (key/value pair) for the specified key from the map, returns a copy of the value that was mapped to the key.Care must be taken when using this operation as it will throw an exception if there is no mapping for the given key.

Parameters
keyThe search key whose mapping is to be removed.
Returns
a copy of the element that was previously mapped to the given key.
Exceptions
NoSuchElementExceptionif this key is not in the Map.
UnsupportedOperationExceptionif this map is unmodifiable.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::remove ( const K &  key,
const V &  value 
)
inlinevirtual

Remove entry for key only if currently mapped to given value.

Acts as

if( map.containsKey( key ) && ( map.get( key ) == value ) ) {
    map.remove( key );
    return true;
} else {
    return false;
}

except that the action is performed atomically.

Parameters
keykey with which the specified value is associated.
valuevalue associated with the specified key.
Returns
true if the value was removed, false otherwise

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::replace ( const K &  key,
const V &  oldValue,
const V &  newValue 
)
inlinevirtual

Replace entry for key only if currently mapped to given value.

Acts as

if( map.containsKey( key ) && ( map.get( key ) == oldValue ) ) {
    map.put( key, newValue );
    return true;
} else {
    return false;
}

except that the action is performed atomically.

Parameters
keykey with which the specified value is associated.
oldValuevalue expected to be associated with the specified key.
newValuevalue to be associated with the specified key.
Returns
true if the value was replaced

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
V decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::replace ( const K &  key,
const V &  value 
)
inlinevirtual

Replace entry for key only if currently mapped to some value.

Acts as

if( map.containsKey( key ) ) {
    return map.put( key, value );
} else {
    throw NoSuchElementException(...);
};

except that the action is performed atomically.

Parameters
keykey with which the specified value is associated.
valuevalue to be associated with the specified key.
Returns
copy of the previous value associated with specified key, or throws an NoSuchElementException if there was no mapping for key.
Exceptions
NoSuchElementExceptionif there was no previous mapping.

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual int decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::size ( ) const
inlinevirtual

Returns
The number of elements (key/value pairs) in this map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::tryLock ( )
inlinevirtual

Attempts to Lock the object, if the lock is already held by another thread than this method returns false.

Returns
true if the lock was acquired, false if it is already held by another thread.
Exceptions
RuntimeExceptionif an error occurs while locking the object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::unlock ( )
inlinevirtual

Unlocks the object.

Exceptions
RuntimeExceptionif an error occurs while unlocking the object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual Collection<V>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::values ( )
inlinevirtual

Returns a Collection view of the values contained in this map.

The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations. For the const version of this method the Collection can only be used as a view into the Map.

Returns
a collection view of the values contained in this map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const Collection<V>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::values ( ) const
inlinevirtual
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::wait ( )
inlinevirtual

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling.

Exceptions
RuntimeExceptionif an error occurs while waiting on the object.
InterruptedExceptionif the wait is interrupted before it completes.
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::wait ( long long  millisecs)
inlinevirtual

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling. This wait will timeout after the specified time interval.

Parameters
millisecsthe time in milliseconds to wait, or WAIT_INIFINITE
Exceptions
RuntimeExceptionif an error occurs while waiting on the object.
InterruptedExceptionif the wait is interrupted before it completes.
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::wait ( long long  millisecs,
int  nanos 
)
inlinevirtual

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling. This wait will timeout after the specified time interval. This method is similar to the one argument wait function except that it add a finer grained control over the amount of time that it waits by adding in the additional nanosecond argument.

NOTE: The ability to wait accurately at a nanosecond scale depends on the platform and OS that the Decaf API is running on, some systems do not provide an accurate enough clock to provide this level of granularity.

Parameters
millisecsthe time in milliseconds to wait, or WAIT_INIFINITE
nanosadditional time in nanoseconds with a range of 0-999999
Exceptions
IllegalArgumentExceptionif an error occurs or the nanos argument is not in the range of [0-999999]
RuntimeExceptionif an error occurs while waiting on the object.
InterruptedExceptionif the wait is interrupted before it completes.
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.


The documentation for this class was generated from the following file: