Class CollectionTools.IdentityMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
org.apache.commons.collections4.map.AbstractHashedMap<K,V>
org.apache.commons.collections4.map.HashedMap<K,V>
de.aristaflow.adept2.util.CollectionTools.IdentityMap<K,V>
Type Parameters:
K - The type of the keys in the map.
V - The type of the values in the map.
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, org.apache.commons.collections4.Get<K,V>, org.apache.commons.collections4.IterableGet<K,V>, org.apache.commons.collections4.IterableMap<K,V>, org.apache.commons.collections4.Put<K,V>
Enclosing class:
CollectionTools

public static final class CollectionTools.IdentityMap<K,V> extends org.apache.commons.collections4.map.HashedMap<K,V>
A map considering equalling keys and values based on object identity instead of Object.equals(Object).
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.commons.collections4.map.AbstractHashedMap

    org.apache.commons.collections4.map.AbstractHashedMap.EntrySet<K extends Object,V extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.EntrySetIterator<K extends Object,V extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.HashEntry<K extends Object,V extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.HashIterator<K extends Object,V extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.HashMapIterator<K extends Object,V extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.KeySet<K extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.KeySetIterator<K extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.Values<V extends Object>, org.apache.commons.collections4.map.AbstractHashedMap.ValuesIterator<V extends Object>

    Nested classes/interfaces inherited from class java.util.AbstractMap

    AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>

    Nested classes/interfaces inherited from interface java.util.Map

    Map.Entry<K extends Object,V extends Object>
  • Field Summary

    Fields inherited from class org.apache.commons.collections4.map.AbstractHashedMap

    DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD, GETKEY_INVALID, GETVALUE_INVALID, MAXIMUM_CAPACITY, NO_NEXT_ENTRY, NO_PREVIOUS_ENTRY, NULL, REMOVE_INVALID, SETVALUE_INVALID
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new map equalling keys and values based on object identity.
    IdentityMap(int initialCapacity)
    Creates a new map equalling keys and values based on object identity with the designated initial capacity.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    isEqualKey(Object key1, Object key2)
     
    protected boolean
    isEqualValue(Object value1, Object value2)
     

    Methods inherited from class org.apache.commons.collections4.map.HashedMap

    clone

    Methods inherited from class org.apache.commons.collections4.map.AbstractHashedMap

    addEntry, addMapping, calculateNewCapacity, calculateThreshold, checkCapacity, clear, containsKey, containsValue, convertKey, createEntry, createEntrySetIterator, createKeySetIterator, createValuesIterator, destroyEntry, doReadObject, doWriteObject, ensureCapacity, entryHashCode, entryKey, entryNext, entrySet, entryValue, equals, get, getEntry, hash, hashCode, hashIndex, init, isEmpty, keySet, mapIterator, put, putAll, remove, removeEntry, removeMapping, reuseEntry, size, toString, updateEntry, values

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • IdentityMap

      public IdentityMap()
      Creates a new map equalling keys and values based on object identity.
    • IdentityMap

      public IdentityMap(int initialCapacity)
      Creates a new map equalling keys and values based on object identity with the designated initial capacity.
      Parameters:
      initialCapacity - The initial capacity of the created map.
  • Method Details

    • isEqualKey

      protected boolean isEqualKey(Object key1, Object key2)
      Overrides:
      isEqualKey in class org.apache.commons.collections4.map.AbstractHashedMap<K,V>
    • isEqualValue

      protected boolean isEqualValue(Object value1, Object value2)
      Overrides:
      isEqualValue in class org.apache.commons.collections4.map.AbstractHashedMap<K,V>