com.neeve.lang
Class XLinkedHashMap.Entry<K,V>
java.lang.Object
com.neeve.lang.XLinkedHashMap.Entry<K,V>
- All Implemented Interfaces:
- XCollection.Record, Map.Entry<K,V>
- Enclosing class:
- XLinkedHashMap<K,V>
public static class XLinkedHashMap.Entry<K,V>
- extends Object
- implements Map.Entry<K,V>, XCollection.Record
This class represents a XLinkedHashMap
entry.
Custom XLinkedHashMap
may use a derived implementation.
For example:[code]
static class MyMap extends XLinkedHashMap {
protected MyEntry newEntry() {
return new MyEntry();
}
class MyEntry extends Entry {
X xxx; // Additional entry field (e.g. cross references).
}
}[/code]
NULL
public static final XLinkedHashMap.Entry<?,?> NULL
- Holds NULL entries (to fill empty hole).
getNext
public final XLinkedHashMap.Entry<K,V> getNext()
- Returns the entry after this one.
- Specified by:
getNext
in interface XCollection.Record
- Returns:
- the next entry.
getPrevious
public final XLinkedHashMap.Entry<K,V> getPrevious()
- Returns the entry before this one.
- Specified by:
getPrevious
in interface XCollection.Record
- Returns:
- the previous entry.
getKey
public final K getKey()
- Returns the key for this entry.
- Specified by:
getKey
in interface Map.Entry<K,V>
- Returns:
- the entry key.
getValue
public final V getValue()
- Returns the value for this entry.
- Specified by:
getValue
in interface Map.Entry<K,V>
- Returns:
- the entry value.
setValue
public final V setValue(V value)
- Sets the value for this entry.
- Specified by:
setValue
in interface Map.Entry<K,V>
- Parameters:
value
- the new value.
- Returns:
- the previous value.
equals
public boolean equals(Object that)
- Indicates if this entry is considered equals to the specified entry
(using default value and key equality comparator to ensure symetry).
- Specified by:
equals
in interface Map.Entry<K,V>
- Overrides:
equals
in class Object
- Parameters:
that
- the object to test for equality.
- Returns:
true if both entry have equal keys and values.
false otherwise.
hashCode
public int hashCode()
- Returns the hash code for this entry.
- Specified by:
hashCode
in interface Map.Entry<K,V>
- Overrides:
hashCode
in class Object
- Returns:
- this entry hash code.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2016 Neeve Research, LLC. All Rights Reserved.