info.monitorenter.util.collections
Class Entry

java.lang.Object
  extended by info.monitorenter.util.collections.Entry
All Implemented Interfaces:
Map.Entry

public final class Entry
extends Object
implements Map.Entry

I have written implementations of java.util.Map.Entry in form of

Almost all implementations were plainforward and not hiding any complexity. One could not downcast them to get more methods, and they were replaceable.
That's it! Finally i decided to hardcode it here... .

But don't you start writing methods like:

  public Entry getEntry(String name);
  public void setEntry(Entry entry);
 
Try sticking to the interface java.util.Map.Entry.

Author:
Achim Westermann
See Also:
Map.Entry

Constructor Summary
Entry(Object key, Object value)
          Creates an instance with the given key and value.
 
Method Summary
 Object getKey()
          Maybe null!
 Object getValue()
          Maybe null!
 Object setValue(Object value)
          Sets a new value instance overwriting the old value which is returned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 

Constructor Detail

Entry

public Entry(Object key,
             Object value)
Creates an instance with the given key and value.

Parameters:
key - the key instance to use.
value - the value instance to use.
Method Detail

getKey

public Object getKey()
Maybe null!

Specified by:
getKey in interface Map.Entry
See Also:
Map.Entry.getKey()

getValue

public Object getValue()
Maybe null!

Specified by:
getValue in interface Map.Entry
See Also:
Map.Entry.getValue()

setValue

public Object setValue(Object value)
Sets a new value instance overwriting the old value which is returned.

You may use null. But you will get it back next call!

Specified by:
setValue in interface Map.Entry
Returns:
the previous value instance.
See Also:
Map.Entry.setValue(java.lang.Object)


Copyright © 2001 - 2007 LGPL, All Rights Footloose.