Package repast.simphony.parameter
Interface ParameterSchema
- All Known Implementing Classes:
DefaultParameterSchema
public interface ParameterSchema
Encapsulates the details about a particular individual parameter.
- Author:
- Nick Collier
-
Method Summary
Modifier and TypeMethodDescriptionfromString
(String str) Creates an Object from the String representation.Gets the list of values that constrain this parameter.Gets the numeric range of values that constrain this parameter.Gets the string representation of the values or range that constrain this parameter This will return an empty string if the parameter is not constrained (by a list or range)Gets the convertor, if any, for this ParameterSchema.Gets the default value of the parameter.getName()
Gets the name of the parameter that this is the schema for.getType()
Gets the type of the parameter.void
setDefaultValue
(Object obj) Sets the default value of this parameter.Converts the object into a String representation.boolean
Validates the specified object against the type and optional constraint info for the parameter name.
-
Method Details
-
getType
Class getType()Gets the type of the parameter.- Returns:
- the type of the parameter.
-
getDefaultValue
Object getDefaultValue()Gets the default value of the parameter.- Returns:
- the default value of the parameter.
-
setDefaultValue
Sets the default value of this parameter.- Parameters:
obj
- the new default value
-
getConstrainingRange
SteppedRange getConstrainingRange()Gets the numeric range of values that constrain this parameter. This will return null if the parameter is unconstrained by a numeric range.- Returns:
- the numeric range of values that constrain this parameter or null if the parameter is unconstrained by a range.
-
getConstrainingList
List getConstrainingList()Gets the list of values that constrain this parameter. This will return null if the parameter is unconstrained by a list.- Returns:
- the list of values that constrain this parameter or null if the parameter is unconstrained by a list of possible values.
-
getConstraintString
String getConstraintString()Gets the string representation of the values or range that constrain this parameter This will return an empty string if the parameter is not constrained (by a list or range)- Returns:
- the string representation of the parameter constraints, if unconstrained an empty string
-
validate
Validates the specified object against the type and optional constraint info for the parameter name.- Parameters:
obj
- the object to validate- Returns:
- true if the object is of a type valid for the parameter, otherwise false.
-
getName
String getName()Gets the name of the parameter that this is the schema for.- Returns:
- the name of the parameter that this is the schema for.
-
toString
Converts the object into a String representation.- Parameters:
obj
- the object to convert- Returns:
- the String representation.
-
fromString
Creates an Object from the String representation.- Parameters:
str
- the String representation- Returns:
- the created Object
-
getConverter
StringConverter getConverter()Gets the convertor, if any, for this ParameterSchema.- Returns:
- the convertor, or null if there is no covertor for this ParameterSchema.
-