java.lang.Object
de.grogra.util.ConfigurationSet
- All Implemented Interfaces:
Map
,ModifiableMap
A
ConfigurationSet
is a ModifiableMap
and consists of a set of Configuration
s.
The map associations are the union of the associations of the
individual configurations.- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.grogra.util.ModifiableMap
ModifiableMap.Producer
-
Field Summary
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
-
Constructor Summary
ConstructorDescriptionConfigurationSet
(String name) Creates a new configuration set with the givenname
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Configurable c) Adds the configurations ofc
to this set by invokingConfigurable.addConfigurations(ConfigurationSet)
onc
.void
add
(Configuration c) Addsc
to this set.Returns the value associated withkey
.Returns the union of theKeyDescription
s of the contained configurations.getName()
Returns the name of this set.Mapskey
tovalue
.int
size()
Returns the number of configurations.void
-
Constructor Details
-
ConfigurationSet
Creates a new configuration set with the givenname
.- Parameters:
name
- the name for this set
-
-
Method Details
-
add
Addsc
to this set.- Parameters:
c
- the configuration to be added
-
add
Adds the configurations ofc
to this set by invokingConfigurable.addConfigurations(ConfigurationSet)
onc
. If this method is invoke more than once with the samec
, only the first invocation has an effect.- Parameters:
c
- a configurable object
-
size
public int size()Returns the number of configurations.- Returns:
- number of configurations
-
put
Description copied from interface:ModifiableMap
Mapskey
tovalue
. Following invocations of theget
-method withkey
as key will returnvalue
.- Specified by:
put
in interfaceModifiableMap
- Parameters:
key
- a keyvalue
- the value to be associated withkey
- Returns:
- the previously associated value, or
null
-
get
Description copied from interface:Map
Returns the value associated withkey
. If there is no value associated withkey
,defaultValue
is returned. -
writeBack
public void writeBack() -
getKeyDescriptions
Returns the union of theKeyDescription
s of the contained configurations.- Returns:
- the descriptions for all keys of this set
-
getName
Returns the name of this set.- Returns:
- the name
-