Class IdentityMap

  • All Implemented Interfaces:
    java.util.Map

    public final class IdentityMap
    extends java.lang.Object
    implements java.util.Map
    An IdentityMap that uses reference-equality instead of object-equality. According to its special function it violates some design contracts of the Map interface.
    Since:
    0.9.9
    Version:
    $Revision: 7491 $ $Date: 2006-04-13 10:49:49 -0600 (Thu, 13 Apr 2006) $
    Author:
    Ralf Joachim
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  IdentityMap.Entry
      An entry of the IdentityMap.
    • Constructor Summary

      Constructors 
      Constructor Description
      IdentityMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      boolean containsKey​(java.lang.Object key)
      boolean containsValue​(java.lang.Object value)
      In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
      java.util.Set entrySet()
      In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
      java.lang.Object get​(java.lang.Object key)
      boolean isEmpty()
      java.util.Set keySet()
      java.lang.Object put​(java.lang.Object key, java.lang.Object value)
      void putAll​(java.util.Map map)
      This optional method has not been implemented for IdentityMap instead it throws a UnsupportedOperationException as defined in the Map interface.
      java.lang.Object remove​(java.lang.Object key)
      int size()
      java.util.Collection values()
      In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • IdentityMap

        public IdentityMap()
    • Method Detail

      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map
        See Also:
        Map.clear()
      • size

        public int size()
        Specified by:
        size in interface java.util.Map
        See Also:
        Map.size()
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map
        See Also:
        Map.isEmpty()
      • put

        public java.lang.Object put​(java.lang.Object key,
                                    java.lang.Object value)
        Specified by:
        put in interface java.util.Map
        See Also:
        Map.put(java.lang.Object, java.lang.Object)
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map
        See Also:
        Map.containsKey(java.lang.Object)
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map
        See Also:
        Map.get(java.lang.Object)
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map
        See Also:
        Map.remove(java.lang.Object)
      • keySet

        public java.util.Set keySet()
        Specified by:
        keySet in interface java.util.Map
        See Also:
        Map.keySet()
      • entrySet

        public java.util.Set entrySet()
        In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
        Specified by:
        entrySet in interface java.util.Map
        See Also:
        Map.entrySet()
      • values

        public java.util.Collection values()
        In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
        Specified by:
        values in interface java.util.Map
        See Also:
        Map.values()
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
        Specified by:
        containsValue in interface java.util.Map
        See Also:
        Map.containsValue(java.lang.Object)
      • putAll

        public void putAll​(java.util.Map map)
        This optional method has not been implemented for IdentityMap instead it throws a UnsupportedOperationException as defined in the Map interface.
        Specified by:
        putAll in interface java.util.Map
        See Also:
        Map.putAll(java.util.Map<? extends K, ? extends V>)