Package repast.simphony.parameter
Class FileParameterType
- java.lang.Object
-
- repast.simphony.parameter.FileParameterType
-
- All Implemented Interfaces:
ParameterType<File>
,StringConverter<File>
public class FileParameterType extends Object implements ParameterType<File>, StringConverter<File>
ParameterType and StringConverter for a File type.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description FileParameterType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
fromString(String path)
Returns a new File with the specified pathStringConverter<File>
getConverter()
Gets a StringConverter that can be used to convert objects of this ParameterType to and from strings.Class<File>
getJavaClass()
Gets the Java class associated with this type, i.e.File
getValue(String val)
Creates a File from a path string.String
toString(File obj)
Returns the path of the file.
-
-
-
Method Detail
-
getJavaClass
public Class<File> getJavaClass()
Gets the Java class associated with this type, i.e. a File.- Specified by:
getJavaClass
in interfaceParameterType<File>
- Returns:
- the Java class associated with this type.
-
getValue
public File getValue(String val) throws ParameterFormatException
Creates a File from a path string.- Specified by:
getValue
in interfaceParameterType<File>
- Parameters:
val
- a path.- Returns:
- the created File
- Throws:
ParameterFormatException
- not thrown
-
getConverter
public StringConverter<File> getConverter()
Gets a StringConverter that can be used to convert objects of this ParameterType to and from strings.- Specified by:
getConverter
in interfaceParameterType<File>
- Returns:
- a StringConverter for objects of this parameter type.
-
toString
public String toString(File obj)
Returns the path of the file.- Specified by:
toString
in interfaceStringConverter<File>
- Parameters:
obj
- the Object to convert.- Returns:
- the path of the file.
-
fromString
public File fromString(String path)
Returns a new File with the specified path- Specified by:
fromString
in interfaceStringConverter<File>
- Parameters:
path
- the file path- Returns:
- the new File.
-
-