当前页面:
在线文档首页 >
NetBeans API Javadoc (Current Development Version)
CompactMap.DefaultMapEntry (Editor Utilities) - NetBeans API Javadoc (Current Development Version)
org.netbeans.lib.editor.util
Class CompactMap.DefaultMapEntry<K,V>
java.lang.Object
org.netbeans.lib.editor.util.CompactMap.MapEntry<K,V>
org.netbeans.lib.editor.util.CompactMap.DefaultMapEntry<K,V>
- All Implemented Interfaces:
- Map.Entry<K,V>
- Enclosing class:
- CompactMap<K,V>
public static class CompactMap.DefaultMapEntry<K,V>
- extends CompactMap.MapEntry<K,V>
Default implementation of the map entry similar to e.g. the HashMap
.
It may be extended as well if the should be an additional information stored
in the map entry.
CompactMap.DefaultMapEntry
public CompactMap.DefaultMapEntry(K key)
getKey
public final K getKey()
- Specified by:
getKey
in interface Map.Entry<K,V>
- Specified by:
getKey
in class CompactMap.MapEntry<K,V>
getValue
public final V getValue()
- Specified by:
getValue
in interface Map.Entry<K,V>
- Specified by:
getValue
in class CompactMap.MapEntry<K,V>
setValue
public final V setValue(V value)
- Specified by:
setValue
in interface Map.Entry<K,V>
- Specified by:
setValue
in class CompactMap.MapEntry<K,V>
valueHashCode
protected final int valueHashCode()
- Description copied from class:
CompactMap.MapEntry
- Used by
CompactMap.MapEntry.hashCode()
to return the real hashCode for the value
held by this map entry.
getValue().hashCode
cannot be used in general because
getValue()
may return this
e.g. in case
the value is represented by primitive data type. The method should
use that real value for the hash code computation.
- Specified by:
valueHashCode
in class CompactMap.MapEntry<K,V>
valueEquals
protected final boolean valueEquals(Object value2)
- Description copied from class:
CompactMap.MapEntry
- Used by
CompactMap.MapEntry.equals(Object)
to check whether the value
held by this map entry equals to the the given value.
getValue().equals()
cannot be used in general because
getValue()
may return this
e.g. in case
the value is represented by primitive data type. The method should
use that real value for the operation of this method.
- Specified by:
valueEquals
in class CompactMap.MapEntry<K,V>
- Parameters:
value2
- value to be compared with value stored in this entry.
The argument may be null.
toString
public String toString()
- Overrides:
toString
in class Object