org.apache.commons.configuration

Class ConfigurationMap

public class ConfigurationMap extends AbstractMap

The ConfigurationMap wraps a configuration-collection Configuration instance to provide a Map interface.

Note: This implementation is incomplete.

Since: 1.0

Version: $Revision: 492216 $, $Date: 2007-01-03 17:51:24 +0100 (Mi, 03 Jan 2007) $

Author: Ricardo Gladwell

Nested Class Summary
static classConfigurationMap.ConfigurationSet
Set of entries in the map.
Field Summary
Configurationconfiguration
The Configuration wrapped by this class.
Constructor Summary
ConfigurationMap(Configuration configuration)
Creates a new instance of a ConfigurationMap that wraps the specified Configuration instance.
Method Summary
SetentrySet()
Returns a set with the entries contained in this configuration-based map.
Objectget(Object key)
Returns the value of the specified key.
ConfigurationgetConfiguration()
Returns the wrapped Configuration object.
Objectput(Object key, Object value)
Stores the value for the specified key.

Field Detail

configuration

private Configuration configuration
The Configuration wrapped by this class.

Constructor Detail

ConfigurationMap

public ConfigurationMap(Configuration configuration)
Creates a new instance of a ConfigurationMap that wraps the specified Configuration instance.

Parameters: configuration Configuration instance.

Method Detail

entrySet

public Set entrySet()
Returns a set with the entries contained in this configuration-based map.

Returns: a set with the contained entries

See Also: java.util.Map#entrySet()

get

public Object get(Object key)
Returns the value of the specified key. The key is converted to a string and then passed to the underlying configuration.

Parameters: key the key

Returns: the value of this key

See Also: java.util.Map#get(java.lang.Object)

getConfiguration

public Configuration getConfiguration()
Returns the wrapped Configuration object.

Returns: the wrapped configuration

Since: 1.2

put

public Object put(Object key, Object value)
Stores the value for the specified key. The value is stored in the underlying configuration.

Parameters: key the key (will be converted to a string) value the value

Returns: the old value of this key or null if it is new

See Also: java.util.Map#put(java.lang.Object, java.lang.Object)