Package org.apache.commons.el
Class EnumeratedMap
java.lang.Object
org.apache.commons.el.EnumeratedMap
- All Implemented Interfaces:
Map
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.
- Version:
- $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: luehe $
- Author:
- Nathan Abramson - Art Technology Group
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object pKey) boolean
containsValue
(Object pValue) (package private) Map
Converts to a MapentrySet()
abstract Enumeration
Returns an enumeration of the keysgetAsMap()
Converts the MapSource to a Map.abstract Object
Returns the value associated with the given key, or null if not found.boolean
isEmpty()
abstract boolean
Returns true if it is possible for this data source to changekeySet()
void
int
size()
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 Details
-
mMap
Map mMap
-
-
Constructor Details
-
EnumeratedMap
public EnumeratedMap()
-
-
Method Details
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap
-
containsValue
- Specified by:
containsValue
in interfaceMap
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-
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
Returns the value associated with the given key, or null if not found. -
getAsMap
Converts the MapSource to a Map. If the map is not mutable, this is cached -
convertToMap
Map convertToMap()Converts to a Map
-