pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.configuration
Class MappedConfiguration<K,V>

java.lang.Object
  extended by org.torweg.pulse.configuration.MappedConfiguration<K,V>
Type Parameters:
K - the type of the key (has to be "JAXB-able")
V - the type of the value (has to be "JAXB-able")
All Implemented Interfaces:
java.io.Serializable

public class MappedConfiguration<K,V>
extends java.lang.Object
implements java.io.Serializable

Provides key-based mapping for configurations.

Version:
$Revision: 1387 $
Author:
Christian Schatt, Daniel Dietz
See Also:
Serialized Form

Nested Class Summary
static class MappedConfiguration.MappedConfigurationEntry<K,V>
          The MappedConfigurationEntry as used by MappedConfiguration.
 
Constructor Summary
protected MappedConfiguration()
          The default constructor.
  MappedConfiguration(java.util.Collection<? extends MappedConfiguration.MappedConfigurationEntry<K,V>> e)
          The constructor that sets the MappedConfigurationEntrys.
 
Method Summary
 V get(K k)
          Returns the value of the MappedConfigurationEntry with the given key, or null.
 java.util.Collection<MappedConfiguration.MappedConfigurationEntry<K,V>> getMappings()
          Returns an unmodifiable Collection of the MappedConfigurationEntrys.
protected  void set(K k, V v)
          Either sets the value of the MappedConfigurationEntry with the given key to the given value, or adds a new MappedConfigurationEntry with the given key and value.
protected  void setMappings(java.util.Collection<? extends MappedConfiguration.MappedConfigurationEntry<K,V>> e)
          Sets the MappedConfigurationEntrys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedConfiguration

protected MappedConfiguration()
The default constructor.


MappedConfiguration

public MappedConfiguration(java.util.Collection<? extends MappedConfiguration.MappedConfigurationEntry<K,V>> e)
The constructor that sets the MappedConfigurationEntrys.

Parameters:
e - the MappedConfigurationEntrys to set.
Method Detail

getMappings

public final java.util.Collection<MappedConfiguration.MappedConfigurationEntry<K,V>> getMappings()
Returns an unmodifiable Collection of the MappedConfigurationEntrys.

Returns:
an unmodifiable Collection of the MappedConfigurationEntrys.

setMappings

protected final void setMappings(java.util.Collection<? extends MappedConfiguration.MappedConfigurationEntry<K,V>> e)
Sets the MappedConfigurationEntrys.

Parameters:
e - the MappedConfigurationEntrys to set.

get

public final V get(K k)
Returns the value of the MappedConfigurationEntry with the given key, or null.

Parameters:
k - the key
Returns:
the value, or null

set

protected final void set(K k, V v)
Either sets the value of the MappedConfigurationEntry with the given key to the given value, or adds a new MappedConfigurationEntry with the given key and value.

Parameters:
k - the key
v - the value