de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters
Class FileListParameter

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter<List<T>,List<T>>
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.ListParameter<File>
          extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.FileListParameter

public class FileListParameter
extends ListParameter<File>

Parameter class for a parameter specifying a list of files.


Nested Class Summary
static class FileListParameter.FilesType
          Available types of the files: FileListParameter.FilesType.INPUT_FILES denotes input files, FileListParameter.FilesType.OUTPUT_FILES denotes output files.
 
Field Summary
private  FileListParameter.FilesType filesType
          Specifies the type of the files, i.e. if the files are input or output files.
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.ListParameter
LIST_SEP, SPLIT, VECTOR_SEP, VECTOR_SPLIT
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
 
Constructor Summary
FileListParameter(OptionID optionID, FileListParameter.FilesType filesType)
          Constructs a file list parameter with the given optionID, and file type.
 
Method Summary
 String getSyntax()
          Returns a string representation of the parameter's type.
 String getValueAsString()
          Get the value as string.
protected  List<File> parseValue(Object obj)
          Parse a given value into the destination type.
protected  boolean validate(List<File> obj)
          Validate a value after parsing (e.g. do constrain checks!)
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.ListParameter
asString, getListSize
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter
addConstraint, getDefaultValue, getDefaultValueAsString, getFullDescription, getGivenValue, getName, getOptionID, getShortDescription, getValue, getValuesDescription, hasDefaultValue, hasValuesDescription, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, useDefaultValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filesType

private FileListParameter.FilesType filesType
Specifies the type of the files, i.e. if the files are input or output files.

Constructor Detail

FileListParameter

public FileListParameter(OptionID optionID,
                         FileListParameter.FilesType filesType)
Constructs a file list parameter with the given optionID, and file type.

Parameters:
optionID - the unique id of this file list parameter
filesType - the file type of this file list parameter
Method Detail

getValueAsString

public String getValueAsString()
Get the value as string. May return null

Specified by:
getValueAsString in class Parameter<List<File>,List<File>>
Returns:
Value as string

parseValue

protected List<File> parseValue(Object obj)
                         throws ParameterException
Parse a given value into the destination type.

Specified by:
parseValue in class Parameter<List<File>,List<File>>
Parameters:
obj - Object to parse (may be a string representation!)
Returns:
Parsed object
Throws:
ParameterException - when the object cannot be parsed.

validate

protected boolean validate(List<File> obj)
                    throws ParameterException
Validate a value after parsing (e.g. do constrain checks!)

Overrides:
validate in class Parameter<List<File>,List<File>>
Parameters:
obj - Object to validate
Returns:
true iff the object is valid for this parameter.
Throws:
ParameterException - when the object is not valid.

getSyntax

public String getSyntax()
Returns a string representation of the parameter's type.

Specified by:
getSyntax in class Parameter<List<File>,List<File>>
Returns:
"<file_1,...,file_n>"

Release 0.4.0 (2011-09-20_1324)