Package repast.simphony.parameter
Class BoundParameters
- java.lang.Object
-
- repast.simphony.parameter.DefaultParameters
-
- repast.simphony.parameter.BoundParameters
-
- All Implemented Interfaces:
Cloneable
,MutableParameters
,Parameters
public class BoundParameters extends DefaultParameters
Parameters implementation that binds a set of parameters to those in some bean.- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
-
Field Summary
-
Fields inherited from class repast.simphony.parameter.DefaultParameters
changed, nameMap, pcs, readOnly, schema, values
-
Fields inherited from interface repast.simphony.parameter.Parameters
NULL
-
-
Constructor Summary
Constructors Constructor Description BoundParameters(Parameters param)
Creates a new BoundParameters using the parameters in the specified Parameters object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameter(String name, Class<?> paramClass, Object val, Method readMethod, Method writeMethod)
void
addParameter(String name, String displayName, Class<?> paramClass, Object val, Method readMethod, Method writeMethod)
Object
getBean()
Gets the bean that is bound the contained parameters.void
setBean(Object bean)
Sets the bean to bind to the contained parameters.void
setValue(String paramName, Object val)
Sets the specified parameter name to the specified value.-
Methods inherited from class repast.simphony.parameter.DefaultParameters
addConstraint, addConstraint, addConvertor, addParameter, addParameter, addPropertyChangeListener, clone, getBoolean, getDisplayName, getDouble, getFloat, getInteger, getLong, getSchema, getString, getValue, getValueAsString, isReadOnly, removeParameter, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
BoundParameters
public BoundParameters(Parameters param)
Creates a new BoundParameters using the parameters in the specified Parameters object.- Parameters:
param
- parameters whose values we want to copy into this BoundParameters
-
-
Method Detail
-
getBean
public Object getBean()
Gets the bean that is bound the contained parameters.- Returns:
- the bean that is bound the contained parameters.
-
setBean
public void setBean(Object bean)
Sets the bean to bind to the contained parameters. This will also set the bean's corresponding properties to the current parameter values.- Parameters:
bean
- the bean to bind.
-
setValue
public void setValue(String paramName, Object val)
Sets the specified parameter name to the specified value.- Specified by:
setValue
in interfaceParameters
- Overrides:
setValue
in classDefaultParameters
- Parameters:
paramName
- the name of the parameter to set to the new valueval
- the new value
-
addParameter
public void addParameter(String name, String displayName, Class<?> paramClass, Object val, Method readMethod, Method writeMethod)
-
-