Package repast.simphony.parameter
Class ParameterUtils
java.lang.Object
repast.simphony.parameter.ParameterUtils
Utility methods for working with Parameters.
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getStringValue
(Class type, StringConverter converter, List values) Converts a list of object values to the string list representationstatic Object[]
parseDefaultValue
(Class type, String name, String val) Parses and converts string representations of primitive values, their Object representations (ie.
-
Constructor Details
-
ParameterUtils
public ParameterUtils()
-
-
Method Details
-
parseDefaultValue
public static Object[] parseDefaultValue(Class type, String name, String val) throws ParameterFormatException Parses and converts string representations of primitive values, their Object representations (ie. int and Integer) and Strings into an array. If the val parameter consists of a single string then the array will contain a single element. If the val parameter consists of more than one space delimited elements then the array will contain that many elements.- Parameters:
type
- the type of the objectname
- the name of the parameterval
- the list of string values to convert- Returns:
- an array of the converted values.
- Throws:
ParameterFormatException
- if there is a parsing or converting errorIllegalArgumentException
- if the type is not a primitive, a primitive Object or a String.
-
getStringValue
Converts a list of object values to the string list representation
-