Class 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:
    Serialized Form
    • 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>
    • 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
      IdentityMap()
      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.
    • Constructor Detail

      • 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 Detail

      • 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>