public class FileParameter extends AbstractParameter<FileParameter,java.io.File>
Modifier and Type | Class and Description |
---|---|
static class |
FileParameter.FileType
Available file types:
FileParameter.FileType.INPUT_FILE denotes an input file,
FileParameter.FileType.OUTPUT_FILE denotes an output file. |
Modifier and Type | Field and Description |
---|---|
private FileParameter.FileType |
fileType
The file type of this file parameter.
|
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
Constructor and Description |
---|
FileParameter(OptionID optionID,
FileParameter.FileType fileType)
Constructs a file parameter with the given optionID, and file type.
|
FileParameter(OptionID optionID,
FileParameter.FileType fileType,
boolean optional)
Constructs a file parameter with the given optionID, file type, and
optional flag.
|
Modifier and Type | Method and Description |
---|---|
FileParameter.FileType |
getFileType()
Get the file type (input / output)
|
java.lang.String |
getSyntax()
Returns a string representation of the parameter's type.
|
java.lang.String |
getValueAsString()
Get the value as string.
|
protected java.io.File |
parseValue(java.lang.Object obj)
Parse a given value into the destination type.
|
protected boolean |
validate(java.io.File obj)
Validate a value after parsing (e.g. do constraint checks!)
|
addConstraint, describeValues, getConstraints, getDefaultValue, getDefaultValueAsString, getOptionID, getShortDescription, getValue, hasDefaultValue, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue
private FileParameter.FileType fileType
public FileParameter(OptionID optionID, FileParameter.FileType fileType)
optionID
- optionID the unique id of the optionfileType
- the file type of this file parameterpublic FileParameter(OptionID optionID, FileParameter.FileType fileType, boolean optional)
optionID
- optionID the unique id of the optionfileType
- the file type of this file parameteroptional
- specifies if this parameter is an optional parameterpublic java.lang.String getValueAsString()
Parameter
null
getValueAsString
in interface Parameter<java.io.File>
getValueAsString
in class AbstractParameter<FileParameter,java.io.File>
protected java.io.File parseValue(java.lang.Object obj) throws ParameterException
AbstractParameter
parseValue
in class AbstractParameter<FileParameter,java.io.File>
obj
- Object to parse (may be a string representation!)ParameterException
- when the object cannot be parsed.protected boolean validate(java.io.File obj) throws ParameterException
AbstractParameter
validate
in class AbstractParameter<FileParameter,java.io.File>
obj
- Object to validateParameterException
- when the object is not valid.public java.lang.String getSyntax()
getSyntax
in interface Parameter<java.io.File>
getSyntax
in class AbstractParameter<FileParameter,java.io.File>
public FileParameter.FileType getFileType()
Copyright © 2019 ELKI Development Team. License information.