Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

com::sleepycat::collections::MapEntryParameter Class Reference

Inheritance diagram for com::sleepycat::collections::MapEntryParameter:

com::sleepycat::collections::StoredMapEntry

Public Member Functions

 MapEntryParameter (Object key, Object value)
int hashCode ()
boolean equals (Object other)
final Object getKey ()
final Object getValue ()
Object setValue (Object newValue)
String toString ()

Detailed Description

A simple Map.Entry implementation that can be used as in input parameter. Since a MapEntryParameter is not obtained from a map, it is not attached to any map in particular. To emphasize that changing this object does not change the map, the setValue method always throws UnsupportedOperationException.

Warning: Use of this interface violates the Java Collections interface contract since these state that Map.Entry objects should only be obtained from Map.entrySet() sets, while this class allows constructing them directly. However, it is useful for performing operations on an entry set such as add(), contains(), etc. For restrictions see getValue and setValue.

Author:
Mark Hayes

Definition at line 30 of file MapEntryParameter.java.


Constructor & Destructor Documentation

com::sleepycat::collections::MapEntryParameter::MapEntryParameter Object  key,
Object  value
[inline]
 

Creates a map entry with a given key and value.

Parameters:
key is the key to use.
value is the value to use.

Definition at line 42 of file MapEntryParameter.java.


Member Function Documentation

boolean com::sleepycat::collections::MapEntryParameter::equals Object  other  )  [inline]
 

Compares this entry to a given entry as specified by java.util.Map.Entry#equals.

Returns:
the computed hash code.

Definition at line 66 of file MapEntryParameter.java.

final Object com::sleepycat::collections::MapEntryParameter::getKey  )  [inline]
 

Returns the key of this entry.

Returns:
the key of this entry.

Definition at line 85 of file MapEntryParameter.java.

Referenced by com::sleepycat::collections::StoredMapEntry::setValue().

final Object com::sleepycat::collections::MapEntryParameter::getValue  )  [inline]
 

Returns the value of this entry. Note that this will be the value passed to the constructor or the last value passed to setValue. It will not reflect changes made to a Map.

Returns:
the value of this entry.

Definition at line 97 of file MapEntryParameter.java.

Referenced by com::sleepycat::collections::StoredMapEntry::setValue().

int com::sleepycat::collections::MapEntryParameter::hashCode  )  [inline]
 

Computes a hash code as specified by java.util.Map.Entry#hashCode.

Returns:
the computed hash code.

Definition at line 54 of file MapEntryParameter.java.

Object com::sleepycat::collections::MapEntryParameter::setValue Object  newValue  )  [inline]
 

Always throws UnsupportedOperationException since this object is not attached to a map.

Reimplemented in com::sleepycat::collections::StoredMapEntry.

Definition at line 106 of file MapEntryParameter.java.

String com::sleepycat::collections::MapEntryParameter::toString  )  [inline]
 

Converts the entry to a string representation for debugging.

Returns:
the string representation.

Definition at line 121 of file MapEntryParameter.java.


The documentation for this class was generated from the following file:
Generated on Sun Dec 25 12:15:00 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2