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

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

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

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

java.lang.Object
  extended by org.netbeans.lib.editor.util.CompactMap.MapEntry<K,V>
All Implemented Interfaces:
Map.Entry<K,V>
Direct Known Subclasses:
CompactMap.DefaultMapEntry
Enclosing class:
CompactMap<K,V>

public abstract static class CompactMap.MapEntry<K,V>
extends Object
implements Map.Entry<K,V>

Abstract implementation of the map entry.
This is suitable for the cases when e.g. the value is a primitive data type.


Constructor Summary
CompactMap.MapEntry()
           
 
Method Summary
 boolean equals(Object o)
          Implementation that adheres to Map.Entry.equals(Object) contract.
abstract  K getKey()
           
abstract  V getValue()
           
 int hashCode()
          Implementation that adheres to Map.Entry.hashCode() contract.
 int keyHashCode()
          Get stored hash code of the key contained in this entry.
 CompactMap.MapEntry<K,V> nextMapEntry()
          Get next map entry linked to this one.
abstract  V setValue(V value)
           
protected abstract  boolean valueEquals(Object value2)
          Used by equals(Object) to check whether the value held by this map entry equals to the the given value.
protected abstract  int valueHashCode()
          Used by hashCode() to return the real hashCode for the value held by this map entry.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompactMap.MapEntry

public CompactMap.MapEntry()
Method Detail

getKey

public abstract K getKey()
Specified by:
getKey in interface Map.Entry<K,V>

getValue

public abstract V getValue()
Specified by:
getValue in interface Map.Entry<K,V>

setValue

public abstract V setValue(V value)
Specified by:
setValue in interface Map.Entry<K,V>

valueHashCode

protected abstract int valueHashCode()
Used by 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.


valueEquals

protected abstract boolean valueEquals(Object value2)
Used by 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.

Parameters:
value2 - value to be compared with value stored in this entry. The argument may be null.

nextMapEntry

public final CompactMap.MapEntry<K,V> nextMapEntry()
Get next map entry linked to this one.
This method may be useful after using CompactMap.getFirstEntry(int).


keyHashCode

public final int keyHashCode()
Get stored hash code of the key contained in this entry.
This method may be useful after using CompactMap.getFirstEntry(int) to quickly exclude entries which hash code differs from the requested one.


hashCode

public final int hashCode()
Implementation that adheres to Map.Entry.hashCode() contract.

Specified by:
hashCode in interface Map.Entry<K,V>
Overrides:
hashCode in class Object

equals

public final boolean equals(Object o)
Implementation that adheres to Map.Entry.equals(Object) contract.

Specified by:
equals in interface Map.Entry<K,V>
Overrides:
equals 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.