org.brains2b.collection
Class MapEntry

java.lang.Object
  extended byorg.brains2b.collection.MapEntry
All Implemented Interfaces:
java.util.Map.Entry

public class MapEntry
extends java.lang.Object
implements java.util.Map.Entry

A straightforward implementation of the Map.Entry interface outside the Map class

Since:
TwelBox 0.30
Version:
0.10.1 [19-06-2007]
Author:
dennis@brains2b.nl
See Also:
Map.Entry

Constructor Summary
MapEntry()
          Default Constructor for MapEntry.
MapEntry(java.lang.Object key)
          Constructor for MapEntry.
MapEntry(java.lang.Object key, java.lang.Object value)
          Constructor for MapEntry.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this EntryImpl to another object to see if they are equal The following rules apply: If comparing a EntryImpl equals returns true if they have the same key If comparing a String equals returns true if the String equals the key In all other cases false is returned.
 java.lang.Object getKey()
           
 java.lang.Object getValue()
           
 java.lang.Object setKey(java.lang.Object key)
          sets the Key
 java.lang.Object setValue(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map.Entry
hashCode
 

Constructor Detail

MapEntry

public MapEntry()
Default Constructor for MapEntry.


MapEntry

public MapEntry(java.lang.Object key)
Constructor for MapEntry.

Initializes the MapEntry with key. use setValue to set the value

Parameters:
key - Object

MapEntry

public MapEntry(java.lang.Object key,
                java.lang.Object value)
Constructor for MapEntry.

Initializes the MapEntry with key and value

Parameters:
key - Object
value - Object
Method Detail

getKey

public java.lang.Object getKey()
Specified by:
getKey in interface java.util.Map.Entry
See Also:
Map.Entry.getKey()

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface java.util.Map.Entry
See Also:
Map.Entry.getValue()

setValue

public java.lang.Object setValue(java.lang.Object value)
Specified by:
setValue in interface java.util.Map.Entry
See Also:
Map.Entry.setValue(Object)

setKey

public java.lang.Object setKey(java.lang.Object key)
sets the Key

Prefered method is using the Constructor to initialize the object with at least the key instead of setting or updating the key here.

Parameters:
key - String

equals

public boolean equals(java.lang.Object obj)
Compares this EntryImpl to another object to see if they are equal