org.apache.commons.el

Class EnumeratedMap

public abstract class EnumeratedMap extends Object implements 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

Field Summary
MapmMap
Method Summary
voidclear()
booleancontainsKey(Object pKey)
booleancontainsValue(Object pValue)
MapconvertToMap()
Converts to a Map
SetentrySet()
abstract EnumerationenumerateKeys()
Returns an enumeration of the keys
Objectget(Object pKey)
MapgetAsMap()
Converts the MapSource to a Map.
abstract ObjectgetValue(Object pKey)
Returns the value associated with the given key, or null if not found.
booleanisEmpty()
abstract booleanisMutable()
Returns true if it is possible for this data source to change
SetkeySet()
Objectput(Object pKey, Object pValue)
voidputAll(Map pMap)
Objectremove(Object pKey)
intsize()
Collectionvalues()

Field Detail

mMap

Map mMap

Method Detail

clear

public void clear()

containsKey

public boolean containsKey(Object pKey)

containsValue

public boolean containsValue(Object pValue)

convertToMap

Map convertToMap()
Converts to a Map

entrySet

public Set entrySet()

enumerateKeys

public abstract Enumeration enumerateKeys()
Returns an enumeration of the keys

get

public Object get(Object pKey)

getAsMap

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

getValue

public abstract Object getValue(Object pKey)
Returns the value associated with the given key, or null if not found.

isEmpty

public boolean isEmpty()

isMutable

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

keySet

public Set keySet()

put

public Object put(Object pKey, Object pValue)

putAll

public void putAll(Map pMap)

remove

public Object remove(Object pKey)

size

public int size()

values

public Collection values()
Copyright (c) 2001-2002 - Apache Software Foundation