java::util::Map::Entry Class Reference

Inheritance diagram for java::util::Map::Entry:

Inheritance graph
java::util::AbstractMap::SimpleEntryjava::lang::Interfacejava::lang::Objectjava::util::AbstractMap::ImmutableEntry
[legend]
Collaboration diagram for java::util::Map::Entry:

Collaboration graph
java::lang::Interfacejava::lang::Object
[legend]

List of all members.


Detailed Description

A map entry (key-value pair).

The Map.entrySet method returns a collection-view of the map, whose elements are of this class. The only way to obtain a reference to a map entry is from the iterator of this collection-view. These Map.Entry objects are valid only for the duration of the iteration; more formally, the behavior of a map entry is undefined if the backing map has been modified after the entry was returned by the iterator, except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator.

See also:
Map::entrySet()
Since:
1.2

Public Member Functions

virtual ObjectRef getKey () const =0
 Returns the key corresponding to this entry.
virtual ObjectRef getValue () const =0
 Returns the value corresponding to this entry.
virtual ObjectRef setValue (const ObjectRef &value)=0
 Replaces the value corresponding to this entry with the specified value (optional operation).

Member Function Documentation

virtual ObjectRef java::util::Map::Entry::getKey (  )  const [pure virtual]

Returns the key corresponding to this entry.

Returns:
the key corresponding to this entry.

Implemented in java::util::AbstractMap::SimpleEntry.

virtual ObjectRef java::util::Map::Entry::getValue (  )  const [pure virtual]

Returns the value corresponding to this entry.

If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.

Returns:
the value corresponding to this entry.

Implemented in java::util::AbstractMap::SimpleEntry.

virtual ObjectRef java::util::Map::Entry::setValue ( const ObjectRef value  )  [pure virtual]

Replaces the value corresponding to this entry with the specified value (optional operation).

(Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).

Parameters:
value new value to be stored in this entry.
Returns:
old value corresponding to the entry.
Exceptions:
UnsupportedOperationException if the put operation is not supported by the backing map.
ClassCastException if the class of the specified value prevents it from being stored in the backing map.
IllegalArgumentException if some aspect of this value prevents it from being stored in the backing map.
NullPointerException the backing map does not permit null values, and the specified value is null.

Implemented in java::util::AbstractMap::SimpleEntry, and java::util::AbstractMap::ImmutableEntry.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:49 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3