Module utilities

Class ConfigurationSet

java.lang.Object
de.grogra.util.ConfigurationSet
All Implemented Interfaces:
Map, ModifiableMap

public final class ConfigurationSet extends Object implements ModifiableMap
A ConfigurationSet is a ModifiableMap and consists of a set of Configurations. The map associations are the union of the associations of the individual configurations.
Author:
Ole Kniemeyer
  • Constructor Details

    • ConfigurationSet

      public ConfigurationSet(String name)
      Creates a new configuration set with the given name.
      Parameters:
      name - the name for this set
  • Method Details

    • add

      public void add(Configuration c)
      Adds c to this set.
      Parameters:
      c - the configuration to be added
    • add

      public void add(Configurable c)
      Adds the configurations of c to this set by invoking Configurable.addConfigurations(ConfigurationSet) on c. If this method is invoke more than once with the same c, 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

      public Object put(Object key, Object value)
      Description copied from interface: ModifiableMap
      Maps key to value. Following invocations of the get-method with key as key will return value.
      Specified by:
      put in interface ModifiableMap
      Parameters:
      key - a key
      value - the value to be associated with key
      Returns:
      the previously associated value, or null
    • get

      public Object get(Object key, Object defaultValue)
      Description copied from interface: Map
      Returns the value associated with key. If there is no value associated with key, defaultValue is returned.
      Specified by:
      get in interface Map
      Parameters:
      key - a key for the map
      defaultValue - the default value
      Returns:
      the associated value, or defaultValue
    • writeBack

      public void writeBack()
    • getKeyDescriptions

      public KeyDescription[] getKeyDescriptions()
      Returns the union of the KeyDescriptions of the contained configurations.
      Returns:
      the descriptions for all keys of this set
    • getName

      public String getName()
      Returns the name of this set.
      Returns:
      the name