站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

CompactMap.DefaultMapEntry (Editor Utilities) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.util/1 1.17

org.netbeans.lib.editor.util
Class CompactMap.DefaultMapEntry<K,V>

java.lang.Object
  extended by org.netbeans.lib.editor.util.CompactMap.MapEntry<K,V>
      extended by 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.


Constructor Summary
CompactMap.DefaultMapEntry(K key)
           
 
Method Summary
 K getKey()
           
 V getValue()
           
 V setValue(V value)
           
 String toString()
           
protected  boolean valueEquals(Object value2)
          Used by CompactMap.MapEntry.equals(Object) to check whether the value held by this map entry equals to the the given value.
protected  int valueHashCode()
          Used by CompactMap.MapEntry.hashCode() to return the real hashCode for the value held by this map entry.
 
Methods inherited from class org.netbeans.lib.editor.util.CompactMap.MapEntry
equals, hashCode, keyHashCode, nextMapEntry
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompactMap.DefaultMapEntry

public CompactMap.DefaultMapEntry(K key)
Method Detail

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

org.netbeans.modules.editor.util/1 1.17

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.