Package javax.servlet.jsp.el
Class ImplicitObjectELResolver.EnumeratedMap<K,V>
- java.lang.Object
-
- javax.servlet.jsp.el.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.
-
-
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 Mapjava.util.Set<java.util.Map.Entry<K,V>>
entrySet()
abstract java.util.Enumeration<K>
enumerateKeys()
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)
boolean
isEmpty()
abstract boolean
isMutable()
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()
-
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object pKey)
-
containsValue
public boolean containsValue(java.lang.Object pValue)
-
remove
public V remove(java.lang.Object pKey)
-
values
public java.util.Collection<V> values()
-
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)
- Parameters:
pKey
- The key for which the value should be obtained- 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- Returns:
- A Map created from the source Enumeration
-
-