java::util::AbstractMap::SimpleEntry Class Reference

Inheritance diagram for java::util::AbstractMap::SimpleEntry:

Inheritance graph
java::util::AbstractMap::ImmutableEntryjava::util::Map::Entryjava::lang::Interfacejava::lang::Object
[legend]
Collaboration diagram for java::util::AbstractMap::SimpleEntry:

Collaboration graph
java::util::Map::Entryjava::lang::Interfacejava::lang::Comparablejava::lang::Objectjava::lang::ObjectRef
[legend]

List of all members.

Public Member Functions

 SimpleEntry ()
 SimpleEntry (const Entry &e)
 SimpleEntry (const ObjectRef &_k, const ObjectRef &_v)
virtual ObjectRef getKey () const
 Returns the key corresponding to this entry.
virtual ObjectRef getValue () const
 Returns the value corresponding to this entry.
virtual ObjectRef setValue (const ObjectRef &_v)
 Replaces the value corresponding to this entry with the specified value (optional operation).
virtual jboolean equals (const Object &o) const
 Compares the specified object with this entry for equality.
virtual jboolean equals (const Entry &e) const
virtual jint hashCode () const
 Returns the hash code value for this map entry.
virtual String toString () const
 Returns a string representation of the object.

Protected Attributes

ObjectRef key
ObjectRef value


Constructor & Destructor Documentation

java::util::AbstractMap::SimpleEntry::SimpleEntry (  )  [inline]

java::util::AbstractMap::SimpleEntry::SimpleEntry ( const Entry &  e  )  [inline]

java::util::AbstractMap::SimpleEntry::SimpleEntry ( const ObjectRef _k,
const ObjectRef _v 
) [inline]


Member Function Documentation

virtual ObjectRef java::util::AbstractMap::SimpleEntry::getKey (  )  const [inline, virtual]

Returns the key corresponding to this entry.

Returns:
the key corresponding to this entry.

Implements java::util::Map::Entry.

virtual ObjectRef java::util::AbstractMap::SimpleEntry::getValue (  )  const [inline, 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.

Implements java::util::Map::Entry.

virtual ObjectRef java::util::AbstractMap::SimpleEntry::setValue ( const ObjectRef _v  )  [inline, 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.

Implements java::util::Map::Entry.

Reimplemented in java::util::AbstractMap::ImmutableEntry.

virtual jboolean java::util::AbstractMap::SimpleEntry::equals ( const Object o  )  const [virtual]

Compares the specified object with this entry for equality.

Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if

     (e1.getKey()==null ?
      e2.getKey()==null : e1.getKey().equals(e2.getKey()))  &&
     (e1.getValue()==null ?
      e2.getValue()==null : e1.getValue().equals(e2.getValue()))
 
This ensures that the equals method works properly across different implementations of the Map.Entry interface.

Parameters:
o object to be compared for equality with this map entry.
Returns:
true if the specified object is equal to this map entry.

Reimplemented from java::lang::Object.

Reimplemented in java::util::AbstractMap::ImmutableEntry.

virtual jboolean java::util::AbstractMap::SimpleEntry::equals ( const Entry &  e  )  const [virtual]

virtual jint java::util::AbstractMap::SimpleEntry::hashCode (  )  const [virtual]

Returns the hash code value for this map entry.

The hash code of a map entry e is defined to be:

     (e.getKey()==null   ? 0 : e.getKey().hashCode()) ^
     (e.getValue()==null ? 0 : e.getValue().hashCode())
 
This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.

Returns:
the hash code value for this map entry.
See also:
Object::hashCode()

Object::equals(Object)

equals(Object)

Reimplemented from java::lang::Object.

Reimplemented in java::util::AbstractMap::ImmutableEntry.

virtual String java::util::AbstractMap::SimpleEntry::toString (  )  const [virtual]

Returns a string representation of the object.

In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `</code>', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: <blockquote>

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
</blockquote>

Returns:
a string representation of the object.

Reimplemented from java::lang::Object.

Reimplemented in java::util::AbstractMap::ImmutableEntry.


Member Data Documentation

ObjectRef java::util::AbstractMap::SimpleEntry::key [protected]

ObjectRef java::util::AbstractMap::SimpleEntry::value [protected]


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