Class AbstractUnmodifiableMap<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this map
    V - the type of mapped values
    All Implemented Interfaces:
    java.util.Map<K,​V>
    Direct Known Subclasses:
    HashPMap, IntTreePMap, OrderedPMap, TreePMap

    public abstract class AbstractUnmodifiableMap<K,​V>
    extends java.util.AbstractMap<K,​V>
    A subclass of AbstractMap that overrides the various mutator methods to mark them as deprecated and unconditionally throw UnsupportedOperationException.
    Since:
    3.2.0
    • Nested Class Summary

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

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void clear()
      Deprecated.
      Unsupported operation.
      V compute​(K k, java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
      Deprecated.
      Unsupported operation.
      V computeIfAbsent​(K k, java.util.function.Function<? super K,​? extends V> function)
      Deprecated.
      Unsupported operation.
      V computeIfPresent​(K k, java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
      Deprecated.
      Unsupported operation.
      V merge​(K k, V v, java.util.function.BiFunction<? super V,​? super V,​? extends V> function)
      Deprecated.
      Unsupported operation.
      V put​(K k, V v)
      Deprecated.
      Unsupported operation.
      void putAll​(java.util.Map<? extends K,​? extends V> map)
      Deprecated.
      Unsupported operation.
      V putIfAbsent​(K k, V v)
      Deprecated.
      Unsupported operation.
      V remove​(java.lang.Object o)
      Deprecated.
      Unsupported operation.
      V replace​(K k, V v)
      Deprecated.
      Unsupported operation.
      void replaceAll​(java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
      Deprecated.
      Unsupported operation.
      • Methods inherited from class java.util.AbstractMap

        clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, size, toString, values
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        forEach, getOrDefault, remove, replace
    • Constructor Detail

      • AbstractUnmodifiableMap

        public AbstractUnmodifiableMap()
    • Method Detail

      • clear

        @Deprecated
        public void clear()
        Deprecated.
        Unsupported operation.
        Specified by:
        clear in interface java.util.Map<K,​V>
        Overrides:
        clear in class java.util.AbstractMap<K,​V>
        Throws:
        java.lang.UnsupportedOperationException - always
      • compute

        @Deprecated
        public V compute​(K k,
                         java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • computeIfAbsent

        @Deprecated
        public V computeIfAbsent​(K k,
                                 java.util.function.Function<? super K,​? extends V> function)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • computeIfPresent

        @Deprecated
        public V computeIfPresent​(K k,
                                  java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • merge

        @Deprecated
        public V merge​(K k,
                       V v,
                       java.util.function.BiFunction<? super V,​? super V,​? extends V> function)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • put

        @Deprecated
        public V put​(K k,
                     V v)
        Deprecated.
        Unsupported operation.
        Specified by:
        put in interface java.util.Map<K,​V>
        Overrides:
        put in class java.util.AbstractMap<K,​V>
        Throws:
        java.lang.UnsupportedOperationException - always
      • putAll

        @Deprecated
        public void putAll​(java.util.Map<? extends K,​? extends V> map)
        Deprecated.
        Unsupported operation.
        Specified by:
        putAll in interface java.util.Map<K,​V>
        Overrides:
        putAll in class java.util.AbstractMap<K,​V>
        Throws:
        java.lang.UnsupportedOperationException - always
      • putIfAbsent

        @Deprecated
        public V putIfAbsent​(K k,
                             V v)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • remove

        @Deprecated
        public V remove​(java.lang.Object o)
        Deprecated.
        Unsupported operation.
        Specified by:
        remove in interface java.util.Map<K,​V>
        Overrides:
        remove in class java.util.AbstractMap<K,​V>
        Throws:
        java.lang.UnsupportedOperationException - always
      • replace

        @Deprecated
        public V replace​(K k,
                         V v)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • replaceAll

        @Deprecated
        public void replaceAll​(java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always