Package repast.simphony.parameter
Class DefaultParameterSchema
java.lang.Object
repast.simphony.parameter.DefaultParameterSchema
- All Implemented Interfaces:
- ParameterSchema
Default implementation of ParameterSchema.
- Author:
- Nick Collier
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultParameterSchema(String name, Class type, Object defValue) DefaultParameterSchema(String name, Class type, Object defValue, List possibleValues) DefaultParameterSchema(String name, Class type, Object defValue, SteppedRange constrainingRange) 
- 
Method SummaryModifier 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 StringConverter if any.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.voidsetConstrainingList(List list) Sets the constraining list.voidsetConstrainingRange(SteppedRange range) Sets the constraining range.voidsetConvertor(StringConverter converter) Sets the converter for this schema.voidsetDefaultValue(Object obj) Sets the default value of this parameter.Converts the object into a String representation.booleanValidates the specified object against the type and optional constraint info for the parameter name.
- 
Constructor Details- 
DefaultParameterSchema
- 
DefaultParameterSchema
- 
DefaultParameterSchema
- 
DefaultParameterSchemapublic DefaultParameterSchema(String name, Class type, Object defValue, SteppedRange constrainingRange) 
 
- 
- 
Method Details- 
getConverterGets the StringConverter if any.- Specified by:
- getConverterin interface- ParameterSchema
- Returns:
- the StringConverter
 
- 
setConvertorSets the converter for this schema.- Parameters:
- converter- the converter
 
- 
getNameGets the name of the parameter that this is the schema for.- Specified by:
- getNamein interface- ParameterSchema
- Returns:
- the name of the parameter that this is the schema for.
 
- 
getTypeGets the type of the parameter.- Specified by:
- getTypein interface- ParameterSchema
- Returns:
- the type of the parameter.
 
- 
getDefaultValueGets the default value of the parameter.- Specified by:
- getDefaultValuein interface- ParameterSchema
- Returns:
- the default value of the parameter.
 
- 
setDefaultValueSets the default value of this parameter.- Specified by:
- setDefaultValuein interface- ParameterSchema
- Parameters:
- obj- the new default value
 
- 
setConstrainingListSets the constraining list.- Parameters:
- list- the constraining list
 
- 
setConstrainingRangeSets the constraining range.- Parameters:
- range- the constraining range.
 
- 
getConstrainingRangeGets the numeric range of values that constrain this parameter. This will return null if the parameter is unconstrained by a numeric range.- Specified by:
- getConstrainingRangein interface- ParameterSchema
- Returns:
- the numeric range of values that constrain this parameter or null if the parameter is unconstrained by a range.
 
- 
getConstrainingListGets the list of values that constrain this parameter. This will return null if the parameter is unconstrained by a list.- Specified by:
- getConstrainingListin interface- ParameterSchema
- Returns:
- the list of values that constrain this parameter or null if the parameter is unconstrained by a list of possible values.
 
- 
getConstraintStringGets 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)- Specified by:
- getConstraintStringin interface- ParameterSchema
- Returns:
- the string representation of the parameter constraints, if unconstrained an empty string
 
- 
validateValidates the specified object against the type and optional constraint info for the parameter name.- Specified by:
- validatein interface- ParameterSchema
- Parameters:
- obj- the object to validate
- Returns:
- true if the object is of a type valid for the parameter, otherwise false.
 
- 
toStringDescription copied from interface:ParameterSchemaConverts the object into a String representation.- Specified by:
- toStringin interface- ParameterSchema
- Parameters:
- obj- the object to convert
- Returns:
- the String representation.
 
- 
fromStringDescription copied from interface:ParameterSchemaCreates an Object from the String representation.- Specified by:
- fromStringin interface- ParameterSchema
- Parameters:
- str- the String representation
- Returns:
- the created Object
 
 
-