com.sleepycat.collections
public class MapEntryParameter extends Object implements Entry
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 MapEntryParameter 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 MapEntryParameter and MapEntryParameter.
Constructor Summary | |
---|---|
MapEntryParameter(Object key, Object value)
Creates a map entry with a given key and value.
|
Method Summary | |
---|---|
boolean | equals(Object other)
Compares this entry to a given entry as specified by java.util.Map.Entry#equals.
|
Object | getKey()
Returns the key of this entry.
|
Object | getValue()
Returns the value of this entry. |
int | hashCode()
Computes a hash code as specified by java.util.Map.Entry#hashCode.
|
Object | setValue(Object newValue)
Always throws UnsupportedOperationException since this
object is not attached to a map. |
String | toString()
Converts the entry to a string representation for debugging.
|
Parameters: key is the key to use. value is the value to use.
Returns: the computed hash code.
Returns: the key of this entry.
Returns: the value of this entry.
Returns: the computed hash code.
UnsupportedOperationException
since this
object is not attached to a map.Returns: the string representation.