|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfabric.common.util.AbstractLongKeyMap.SimpleEntry<V>
public static class AbstractLongKeyMap.SimpleEntry<V>
A class which implements Map.Entry. It is shared by HashMap, TreeMap, Hashtable, and Collections. It is not specified by the JDK, but makes life much easier.
Constructor Summary | |
---|---|
AbstractLongKeyMap.SimpleEntry(LongKeyMap.Entry<? extends V> entry)
|
|
AbstractLongKeyMap.SimpleEntry(long newKey,
V newValue)
Basic constructor initializes the fields. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Compares the specified object with this entry. |
long |
getKey()
Get the key corresponding to this entry. |
V |
getValue()
Get the value corresponding to this entry. |
int |
hashCode()
Returns the hash code of the entry. |
V |
setValue(V newVal)
Replaces the value with the specified object. |
java.lang.String |
toString()
This provides a string representation of the entry. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractLongKeyMap.SimpleEntry(long newKey, V newValue)
newKey
- the keynewValue
- the valuepublic AbstractLongKeyMap.SimpleEntry(LongKeyMap.Entry<? extends V> entry)
Method Detail |
---|
public boolean equals(java.lang.Object o)
(o instanceof Map.Entry) && (getKey() == null ? ((HashMap) o).getKey() == null : getKey().equals(((HashMap) o).getKey())) && (getValue() == null ? ((HashMap) o).getValue() == null : getValue().equals(((HashMap) o).getValue()))
equals
in interface LongKeyMap.Entry<V>
equals
in class java.lang.Object
o
- the object to compare
true
if it is equalpublic long getKey()
getKey
in interface LongKeyMap.Entry<V>
public V getValue()
getValue
in interface LongKeyMap.Entry<V>
public int hashCode()
(getKey() == null ? 0 : getKey().hashCode()) ^ (getValue() == null ? 0 : getValue().hashCode())
hashCode
in interface LongKeyMap.Entry<V>
hashCode
in class java.lang.Object
public V setValue(V newVal)
setValue
in interface LongKeyMap.Entry<V>
newVal
- the new value to store
java.lang.NullPointerException
- if the map forbids null values.
java.lang.UnsupportedOperationException
- if the map doesn't support
put()
.
java.lang.ClassCastException
- if the value is of a type unsupported
by the map.
java.lang.IllegalArgumentException
- if something else about this
value prevents it being stored in the map.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |