ca.nengo.config
Interface NamedValueProperty

All Superinterfaces:
Property
All Known Implementing Classes:
NamedValuePropertyImpl

public interface NamedValueProperty
extends Property

A property that can have multiple values, each of which is indexed by a String name.

Author:
Bryan Tripp

Method Summary
 java.lang.Object getValue(java.lang.String name)
           
 java.util.List<java.lang.String> getValueNames()
           
 boolean isNamedAutomatically()
           
 void removeValue(java.lang.String name)
          Removes a value by name
 void setValue(java.lang.Object value)
          Sets an automatically-named value
 void setValue(java.lang.String name, java.lang.Object value)
          Sets a value by name.
 
Methods inherited from interface ca.nengo.config.Property
getDocumentation, getName, getType, isFixedCardinality, isMutable, setName
 

Method Detail

getValue

java.lang.Object getValue(java.lang.String name)
                          throws StructuralException
Parameters:
name - Name of a value of this property
Returns:
The value
Throws:
StructuralException - if there is no value of the given name

isNamedAutomatically

boolean isNamedAutomatically()
Returns:
True if values are named automatically, in which case the setter setValue(Object) can be used; otherwise value names must be provided by the caller via setValue(String, Object)

setValue

void setValue(java.lang.String name,
              java.lang.Object value)
              throws StructuralException
Sets a value by name.

Parameters:
name - Name of the value
value - New value of the value
Throws:
StructuralException - if !isMutable

setValue

void setValue(java.lang.Object value)
              throws StructuralException
Sets an automatically-named value

Parameters:
value - New value of the value, from which the Property can automaticall determine the name
Throws:
StructuralException - if !isNamedAutomatically() or !isMutable

removeValue

void removeValue(java.lang.String name)
                 throws StructuralException
Removes a value by name

Parameters:
name - Name of value to remove
Throws:
StructuralException - if isFixedCardinality()

getValueNames

java.util.List<java.lang.String> getValueNames()
Returns:
Names of all values