Package repast.simphony.parameter
Class BeanParameters
- java.lang.Object
-
- repast.simphony.parameter.BeanParameters
-
- All Implemented Interfaces:
Cloneable
,Parameters
public class BeanParameters extends Object implements Parameters
Implemenentation of Parameters that converts a bean's properties into parameters.- Author:
- Nick Collier
-
-
Field Summary
-
Fields inherited from interface repast.simphony.parameter.Parameters
NULL
-
-
Constructor Summary
Constructors Constructor Description BeanParameters(Object bean)
BeanParameters(Object bean, Set<String> paramNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener listener)
Adds listener that will listen for parameter changes on this Parameters.Parameters
clone()
Method to clone a Parameter object.Object
getBean()
Gets the bean object that this BeanParameters wraps.Boolean
getBoolean(String paramName)
Gets the Boolean value associated with the specified parameter name.String
getDisplayName(String paramName)
Gets the display name for the specified parameter name.Double
getDouble(String paramName)
Gets the Double value associated with the specified parameter name.Float
getFloat(String paramName)
Gets the Float value associated with the specified parameter name.Integer
getInteger(String paramName)
Gets the Integer value associated with the specified parameter name.Long
getLong(String paramName)
Gets the Boolean value associated with the specified parameter name.Schema
getSchema()
Gets the Schema for this Parameters object.String
getString(String paramName)
Gets the String value associated with the specified parameter name.Object
getValue(String paramName)
Gets the value associated with the specified parameter name.String
getValueAsString(String paramName)
Gets a String representation of the specified parameter's value.boolean
isReadOnly(String paramName)
True if parameter is read only.void
removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified listener from the listeners listening to this Parameters object.void
setValue(String paramName, Object val)
Sets the specified parameter name to the specified value.
-
-
-
Method Detail
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface:Parameters
Removes the specified listener from the listeners listening to this Parameters object.- Specified by:
removePropertyChangeListener
in interfaceParameters
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface:Parameters
Adds listener that will listen for parameter changes on this Parameters.- Specified by:
addPropertyChangeListener
in interfaceParameters
-
getSchema
public Schema getSchema()
Gets the Schema for this Parameters object.- Specified by:
getSchema
in interfaceParameters
- Returns:
- the Schema for this Parameters object.
-
clone
public Parameters clone()
Description copied from interface:Parameters
Method to clone a Parameter object.- Specified by:
clone
in interfaceParameters
- Overrides:
clone
in classObject
- Returns:
- a Parameter clone.
-
getValue
public Object getValue(String paramName)
Gets the value associated with the specified parameter name.- Specified by:
getValue
in interfaceParameters
- Parameters:
paramName
- the name of the parameter whose value we want- Returns:
- the value associated with the specified parameter name.
-
getValueAsString
public String getValueAsString(String paramName)
Gets a String representation of the specified parameter's value.- Specified by:
getValueAsString
in interfaceParameters
- Parameters:
paramName
- the name of the parameter- Returns:
- a String representation of the specified parameters's value.
-
setValue
public void setValue(String paramName, Object val)
Sets the specified parameter name to the specified value.- Specified by:
setValue
in interfaceParameters
- Parameters:
paramName
- the name of the parameter to set to the new valueval
- the new value
-
isReadOnly
public boolean isReadOnly(String paramName)
True if parameter is read only.- Specified by:
isReadOnly
in interfaceParameters
- Parameters:
paramName
- the name of the parameter- Returns:
- true if parameter is read-only otherwise false.
-
getBean
public Object getBean()
Gets the bean object that this BeanParameters wraps.- Returns:
- the bean object that this BeanParameters wraps.
-
getDisplayName
public String getDisplayName(String paramName)
Gets the display name for the specified parameter name.- Specified by:
getDisplayName
in interfaceParameters
- Parameters:
paramName
- the parameter name- Returns:
- the display name for the specified parameter name.
-
getDouble
public Double getDouble(String paramName)
Gets the Double value associated with the specified parameter name.- Specified by:
getDouble
in interfaceParameters
- Parameters:
paramName
- the name of the parameter whose value we want- Returns:
- the value associated with the specified parameter name.
-
getInteger
public Integer getInteger(String paramName)
Gets the Integer value associated with the specified parameter name.- Specified by:
getInteger
in interfaceParameters
- Parameters:
paramName
- the name of the parameter whose value we want- Returns:
- the value associated with the specified parameter name.
-
getBoolean
public Boolean getBoolean(String paramName)
Gets the Boolean value associated with the specified parameter name.- Specified by:
getBoolean
in interfaceParameters
- Parameters:
paramName
- the name of the parameter whose value we want- Returns:
- the value associated with the specified parameter name.
-
getString
public String getString(String paramName)
Gets the String value associated with the specified parameter name.- Specified by:
getString
in interfaceParameters
- Parameters:
paramName
- the name of the parameter whose value we want- Returns:
- the value associated with the specified parameter name.
-
getLong
public Long getLong(String paramName)
Gets the Boolean value associated with the specified parameter name.- Specified by:
getLong
in interfaceParameters
- Parameters:
paramName
- the name of the parameter whose value we want- Returns:
- the value associated with the specified parameter name.
-
getFloat
public Float getFloat(String paramName)
Gets the Float value associated with the specified parameter name.- Specified by:
getFloat
in interfaceParameters
- Parameters:
paramName
- the name of the parameter whose value we want- Returns:
- the value associated with the specified parameter name.
-
-