java::util::AbstractMap::ImmutableEntry Class Reference

Inheritance diagram for java::util::AbstractMap::ImmutableEntry:

Inheritance graph
Collaboration diagram for java::util::AbstractMap::ImmutableEntry:

Collaboration graph

List of all members.

Public Member Functions

 ImmutableEntry ()
 ImmutableEntry (const ObjectRef &key, const ObjectRef &value)
virtual ObjectRef setValue (const ObjectRef &value)
 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 jint hashCode () const
 Returns the hash code value for this map entry.
virtual String toString () const
 Returns a string representation of the object.

Constructor & Destructor Documentation

java::util::AbstractMap::ImmutableEntry::ImmutableEntry (  ) 

java::util::AbstractMap::ImmutableEntry::ImmutableEntry ( const ObjectRef key,
const ObjectRef value 

Member Function Documentation

virtual ObjectRef java::util::AbstractMap::ImmutableEntry::setValue ( const ObjectRef value  )  [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).

value new value to be stored in this entry.
old value corresponding to the entry.
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.

Reimplemented from java::util::AbstractMap::SimpleEntry.

virtual jboolean java::util::AbstractMap::ImmutableEntry::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.

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

Reimplemented from java::util::AbstractMap::SimpleEntry.

virtual jint java::util::AbstractMap::ImmutableEntry::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.

the hash code value for this map entry.
See also:



Reimplemented from java::util::AbstractMap::SimpleEntry.

virtual String java::util::AbstractMap::ImmutableEntry::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())

a string representation of the object.

Reimplemented from java::util::AbstractMap::SimpleEntry.

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