Package repast.simphony.parameter
Class StringConverterFactory
- java.lang.Object
-
- repast.simphony.parameter.StringConverterFactory
-
public class StringConverterFactory extends Object
- Author:
- Nick Collier Date: Dec 22, 2008 3:50:56 PM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringConverterFactory.BooleanConverter
static class
StringConverterFactory.ByteConverter
static class
StringConverterFactory.DoubleConverter
static class
StringConverterFactory.FloatConverter
static class
StringConverterFactory.IntConverter
static class
StringConverterFactory.LongConverter
static class
StringConverterFactory.ShortConverter
static class
StringConverterFactory.StringStringConverter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> void
addConverter(Class<T> clazz, StringConverter<T> converter)
Adds a converter to the factory for the specified class.<T> StringConverter<T>
getConverter(Class<T> clazz)
Get StringConverter appropriate for the specified class.static StringConverterFactory
instance()
Gets the singleton instance.
-
-
-
Method Detail
-
instance
public static StringConverterFactory instance()
Gets the singleton instance.- Returns:
- the singleton instance.
-
getConverter
public <T> StringConverter<T> getConverter(Class<T> clazz)
Get StringConverter appropriate for the specified class.- Type Parameters:
T
- the type of the class- Parameters:
clazz
- the class to get the StringConverter for- Returns:
- the StringConverter. This can return NULL, if no StringConverter has been registered.
-
addConverter
public <T> void addConverter(Class<T> clazz, StringConverter<T> converter)
Adds a converter to the factory for the specified class.- Type Parameters:
T
- the type the converter works on- Parameters:
clazz
- the class the converter works withconverter
- the converter
-
-