org.apache.commons.el
Class EnumeratedMap

java.lang.Object
  |
  +--org.apache.commons.el.EnumeratedMap
All Implemented Interfaces:
java.util.Map
Direct Known Subclasses:
ImplicitObjects$1, ImplicitObjects$2, ImplicitObjects$3, ImplicitObjects$4, ImplicitObjects$5, ImplicitObjects$6, ImplicitObjects$7, ImplicitObjects$8, ImplicitObjects$9

public abstract class EnumeratedMap
extends java.lang.Object
implements java.util.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
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
(package private)  java.util.Map mMap
           
 
Constructor Summary
EnumeratedMap()
           
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object pKey)
           
 boolean containsValue(java.lang.Object pValue)
           
(package private)  java.util.Map convertToMap()
          Converts to a Map
 java.util.Set entrySet()
           
abstract  java.util.Enumeration enumerateKeys()
          Returns an enumeration of the keys
 java.lang.Object get(java.lang.Object pKey)
           
 java.util.Map getAsMap()
          Converts the MapSource to a Map.
abstract  java.lang.Object 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 keySet()
           
 java.lang.Object put(java.lang.Object pKey, java.lang.Object pValue)
           
 void putAll(java.util.Map pMap)
           
 java.lang.Object remove(java.lang.Object pKey)
           
 int size()
           
 java.util.Collection 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
equals, hashCode
 

Field Detail

mMap

java.util.Map mMap
Constructor Detail

EnumeratedMap

public EnumeratedMap()
Method Detail

clear

public void clear()
Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object pKey)
Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object pValue)
Specified by:
containsValue in interface java.util.Map

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map

get

public java.lang.Object get(java.lang.Object pKey)
Specified by:
get in interface java.util.Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map

put

public java.lang.Object put(java.lang.Object pKey,
                            java.lang.Object pValue)
Specified by:
put in interface java.util.Map

putAll

public void putAll(java.util.Map pMap)
Specified by:
putAll in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object pKey)
Specified by:
remove in interface java.util.Map

size

public int size()
Specified by:
size in interface java.util.Map

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map

enumerateKeys

public abstract java.util.Enumeration 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 java.lang.Object getValue(java.lang.Object pKey)
Returns the value associated with the given key, or null if not found.


getAsMap

public java.util.Map getAsMap()
Converts the MapSource to a Map. If the map is not mutable, this is cached


convertToMap

java.util.Map convertToMap()
Converts to a Map



Copyright (c) 2001-2002 - Apache Software Foundation