Package repast.simphony.parameter
Class FileParameterType
java.lang.Object
repast.simphony.parameter.FileParameterType
- All Implemented Interfaces:
ParameterType<File>
,StringConverter<File>
ParameterType and StringConverter for a File type.
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromString
(String path) Returns a new File with the specified pathGets a StringConverter that can be used to convert objects of this ParameterType to and from strings.Gets the Java class associated with this type, i.e.Creates a File from a path string.Returns the path of the file.
-
Constructor Details
-
FileParameterType
public FileParameterType()
-
-
Method Details
-
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
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
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
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
Returns a new File with the specified path- Specified by:
fromString
in interfaceStringConverter<File>
- Parameters:
path
- the file path- Returns:
- the new File.
-