Package repast.simphony.scenario.data
Class AttributeFactory.PType
- java.lang.Object
-
- repast.simphony.scenario.data.AttributeFactory.PType
-
- All Implemented Interfaces:
ParameterType
- Enclosing class:
- AttributeFactory
public static class AttributeFactory.PType extends Object implements ParameterType
-
-
Constructor Summary
Constructors Constructor Description PType(Class<?> clazz, StringConverter conv)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringConverter
getConverter()
Gets a StringConverter that can be used to convert objects of this ParameterType to and from strings.Class
getJavaClass()
Gets the Java class associated with this type.Object
getValue(String val)
Gets an initial or default value for a parameter of this type from the string.
-
-
-
Constructor Detail
-
PType
public PType(Class<?> clazz, StringConverter conv)
-
-
Method Detail
-
getConverter
public StringConverter getConverter()
Description copied from interface:ParameterType
Gets a StringConverter that can be used to convert objects of this ParameterType to and from strings.- Specified by:
getConverter
in interfaceParameterType
- Returns:
- a StringConverter for objects of this parameter type.
-
getJavaClass
public Class getJavaClass()
Description copied from interface:ParameterType
Gets the Java class associated with this type.- Specified by:
getJavaClass
in interfaceParameterType
- Returns:
- the Java class associated with this type.
-
getValue
public Object getValue(String val) throws ParameterFormatException
Description copied from interface:ParameterType
Gets an initial or default value for a parameter of this type from the string. If the string is space separated list of values the first value will be used.- Specified by:
getValue
in interfaceParameterType
- Parameters:
val
- a string representation of default value- Returns:
- the default value of the string.
- Throws:
ParameterFormatException
- if string cannot be converted into an object of the appropriate type
-
-