org.apache.commons.collections

Class DefaultMapEntry

Implemented Interfaces:
Map.Entry
Known Direct Subclasses:
BeanMap.MyMapEntry

public class DefaultMapEntry
extends java.lang.Object
implements Map.Entry

A default implementation of java.util.Map.Entry
Authors:
James Strachan
Michael A. Smith
Since:
1.0

Constructor Summary

DefaultMapEntry()
Constructs a new DefaultMapEntry with a null key and null value.
DefaultMapEntry(Object key, Object value)
Constructs a new DefaultMapEntry with the given key and given value.

Method Summary

boolean
equals(Object o)
Implemented per API documentation of java.util.Map.Entry.equals(Object)
Object
getKey()
Returns the key.
Object
getValue()
Returns the value.
int
hashCode()
Implemented per API documentation of java.util.Map.Entry.hashCode()
void
setKey(Object key)
Sets the key.
Object
setValue(Object value)
Note that this method only sets the local reference inside this object and does not modify the original Map.

Constructor Details

DefaultMapEntry

public DefaultMapEntry()
Constructs a new DefaultMapEntry with a null key and null value.

DefaultMapEntry

public DefaultMapEntry(Object key,
                       Object value)
Constructs a new DefaultMapEntry with the given key and given value.
Parameters:
key - the key for the entry, may be null
value - the value for the entyr, may be null

Method Details

equals

public boolean equals(Object o)
Implemented per API documentation of java.util.Map.Entry.equals(Object)

getKey

public Object getKey()
Returns the key.
Returns:
the key

getValue

public Object getValue()
Returns the value.
Returns:
the value

hashCode

public int hashCode()
Implemented per API documentation of java.util.Map.Entry.hashCode()

setKey

public void setKey(Object key)
Sets the key. This method does not modify any map.
Parameters:
key - the new key

setValue

public Object setValue(Object value)
Note that this method only sets the local reference inside this object and does not modify the original Map.
Parameters:
value - the new value
Returns:
the old value of the value

Copyright © 2001-2004 Apache Software Foundation. Documenation generated ${TODAY}.