ca.nengo.config.impl
Class ConfigurationImpl

java.lang.Object
  extended by ca.nengo.config.impl.ConfigurationImpl
All Implemented Interfaces:
Configuration

public class ConfigurationImpl
extends java.lang.Object
implements Configuration

Default implementation of Configuration. This implementation reports property names in the order they are defined.

Author:
Bryan Tripp

Constructor Summary
ConfigurationImpl(java.lang.Object configurable)
           
 
Method Summary
 void defineProperty(Property property)
          To be called by the associated Configurable, immediately after construction (once per property).
 SingleValuedPropertyImpl defineSingleValuedProperty(java.lang.String name, java.lang.Class<?> c, boolean mutable)
           
 TemplateProperty defineTemplateProperty(java.lang.String name, java.lang.Class<?> c, java.lang.Object defaultValue)
           
 java.lang.Object getConfigurable()
           
 Property getProperty(java.lang.String name)
           
 java.util.List<java.lang.String> getPropertyNames()
           
 void removeProperty(java.lang.String name)
           
 void renameProperty(java.lang.String oldName, java.lang.String newName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationImpl

public ConfigurationImpl(java.lang.Object configurable)
Parameters:
configurable - The Object to which this Configuration belongs
Method Detail

getConfigurable

public java.lang.Object getConfigurable()
Specified by:
getConfigurable in interface Configuration
Returns:
The Object to which this Configuration belongs
See Also:
Configuration.getConfigurable()

defineProperty

public void defineProperty(Property property)
To be called by the associated Configurable, immediately after construction (once per property).

Parameters:
property - The new Property

removeProperty

public void removeProperty(java.lang.String name)
Parameters:
name - Property to remove

renameProperty

public void renameProperty(java.lang.String oldName,
                           java.lang.String newName)
Parameters:
oldName - The existing name of the Property
newName - The replacement name of the Property

defineSingleValuedProperty

public SingleValuedPropertyImpl defineSingleValuedProperty(java.lang.String name,
                                                           java.lang.Class<?> c,
                                                           boolean mutable)

defineTemplateProperty

public TemplateProperty defineTemplateProperty(java.lang.String name,
                                               java.lang.Class<?> c,
                                               java.lang.Object defaultValue)

getPropertyNames

public java.util.List<java.lang.String> getPropertyNames()
Specified by:
getPropertyNames in interface Configuration
Returns:
Names of configuration properties
See Also:
Configuration.getPropertyNames()

getProperty

public Property getProperty(java.lang.String name)
                     throws StructuralException
Specified by:
getProperty in interface Configuration
Parameters:
name - Name of a configuration property
Returns:
Parameter of the given name
Throws:
StructuralException - if the named property does not exist
See Also:
Configuration.getProperty(java.lang.String)