Class ImplicitObjectELResolver.EnumeratedMap<K,​V>

  • All Implemented Interfaces:
    java.util.Map<K,​V>
    Enclosing class:
    ImplicitObjectELResolver

    private abstract static class ImplicitObjectELResolver.EnumeratedMap<K,​V>
    extends java.lang.Object
    implements java.util.Map<K,​V>

    This is a Map implementation driven by a data source that only provides an enumeration of keys and a getValue(key) method. This class must be subclassed to implement those methods.

    Some of the methods may incur a performance penalty that involves enumerating the entire data source. In these cases, the Map will try to save the results of that enumeration, but only if the underlying data source is immutable.

    • Nested Class Summary

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

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

      Fields 
      Modifier and Type Field Description
      (package private) java.util.Map<K,​V> mMap  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private EnumeratedMap()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      boolean containsKey​(java.lang.Object pKey)  
      boolean containsValue​(java.lang.Object pValue)  
      (package private) java.util.Map<K,​V> convertToMap()
      Converts to a Map
      java.util.Set<java.util.Map.Entry<K,​V>> entrySet()  
      abstract java.util.Enumeration<K> enumerateKeys()
      Returns an enumeration of the keys
      V get​(java.lang.Object pKey)  
      java.util.Map<K,​V> getAsMap()
      Converts the MapSource to a Map.
      abstract V getValue​(java.lang.Object pKey)
      Returns the value associated with the given key, or null if not found.
      boolean isEmpty()  
      abstract boolean isMutable()
      Returns true if it is possible for this data source to change
      java.util.Set<K> keySet()  
      V put​(K pKey, V pValue)  
      void putAll​(java.util.Map<? extends K,​? extends V> pMap)  
      V remove​(java.lang.Object pKey)  
      int size()  
      java.util.Collection<V> values()  
      • 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
    • Field Detail

      • mMap

        java.util.Map<K,​V> mMap
    • Constructor Detail

      • EnumeratedMap

        private EnumeratedMap()
    • Method Detail

      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<K,​V>
      • containsKey

        public boolean containsKey​(java.lang.Object pKey)
        Specified by:
        containsKey in interface java.util.Map<K,​V>
      • containsValue

        public boolean containsValue​(java.lang.Object pValue)
        Specified by:
        containsValue in interface java.util.Map<K,​V>
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<K,​V>
      • get

        public V get​(java.lang.Object pKey)
        Specified by:
        get in interface java.util.Map<K,​V>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<K,​V>
      • keySet

        public java.util.Set<K> keySet()
        Specified by:
        keySet in interface java.util.Map<K,​V>
      • put

        public V put​(K pKey,
                     V pValue)
        Specified by:
        put in interface java.util.Map<K,​V>
      • putAll

        public void putAll​(java.util.Map<? extends K,​? extends V> pMap)
        Specified by:
        putAll in interface java.util.Map<K,​V>
      • remove

        public V remove​(java.lang.Object pKey)
        Specified by:
        remove in interface java.util.Map<K,​V>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<K,​V>
      • values

        public java.util.Collection<V> values()
        Specified by:
        values in interface java.util.Map<K,​V>
      • enumerateKeys

        public abstract java.util.Enumeration<K> enumerateKeys()
        Returns an enumeration of the keys
      • isMutable

        public abstract boolean isMutable()
        Returns true if it is possible for this data source to change
      • getValue

        public abstract V getValue​(java.lang.Object pKey)
        Returns the value associated with the given key, or null if not found.
      • getAsMap

        public java.util.Map<K,​V> getAsMap()
        Converts the MapSource to a Map. If the map is not mutable, this is cached
      • convertToMap

        java.util.Map<K,​V> convertToMap()
        Converts to a Map