|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.monitorenter.util.collections.Entry<V,K>
V
- the key type.K
- the value type.public final class Entry<V,K>
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.
Map.Entry
Constructor Summary | |
---|---|
Entry(V key,
K value)
Creates an instance with the given key and value. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
V |
getKey()
Maybe null! |
K |
getValue()
Maybe null! |
int |
hashCode()
|
K |
setValue(K value)
Sets a new value instance overwriting the old value which is returned. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Entry(V key, K value)
key
- the key instance to use.value
- the value instance to use.Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Map.Entry<V,K>
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public V getKey()
getKey
in interface java.util.Map.Entry<V,K>
Map.Entry.getKey()
public K getValue()
getValue
in interface java.util.Map.Entry<V,K>
Map.Entry.getValue()
public int hashCode()
hashCode
in interface java.util.Map.Entry<V,K>
hashCode
in class java.lang.Object
Object.hashCode()
public K setValue(K value)
You may use null. But you will get it back next call!
setValue
in interface java.util.Map.Entry<V,K>
Map.Entry.setValue(java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |