Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.optionhandling
Class FileParameter

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.Option<T>
          extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameter<File,Object>
              extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.FileParameter
All Implemented Interfaces:
Loggable

public class FileParameter
extends Parameter<File,Object>

Parameter class for a parameter specifying a file.

Author:
Steffi Wanka

Nested Class Summary
static class FileParameter.FileType
          Available file types: FileParameter.FileType.INPUT_FILE denotes an input file, FileParameter.FileType.OUTPUT_FILE denotes an output file.
 
Field Summary
private  FileParameter.FileType fileType
          The file type of this file parameter.
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameter
constraints, defaultValue, optionalParameter
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.Option
name, shortDescription, value
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
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.
FileParameter(String name, String description, FileParameter.FileType fileType)
          Deprecated.  
 
Method Summary
protected  String getParameterType()
          Returns a string representation of the parameter's type.
 boolean isValid(String value)
          Checks if the given argument is valid for this option.
 void setValue(String value)
          Sets the value of the option.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameter
addConstraint, addConstraintList, getDefaultValue, getDescription, getValue, hasDefaultValue, isOptional, isSet, reset, setDefaultValue, setDefaultValueToValue, setOptional, tookDefaultValue
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.Option
getName, getShortDescription, setShortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileType

private FileParameter.FileType fileType
The file type of this file parameter. Specifies if the file is an input of output file.

Constructor Detail

FileParameter

public FileParameter(OptionID optionID,
                     FileParameter.FileType fileType)
Constructs a file parameter with the given optionID, and file type.

Parameters:
optionID - optionID the unique id of the option
fileType - the file type of this file parameter

FileParameter

public FileParameter(OptionID optionID,
                     FileParameter.FileType fileType,
                     boolean optional)
Constructs a file parameter with the given optionID, file type, and optional flag.

Parameters:
optionID - optionID the unique id of the option
fileType - the file type of this file parameter
optional - specifies if this parameter is an optional parameter

FileParameter

@Deprecated
public FileParameter(String name,
                                String description,
                                FileParameter.FileType fileType)
Deprecated. 

Constructs a file parameter with the given name, description, and file type.

Parameters:
name - the parameter name
description - the parameter description
fileType - the file type of this file parameter
Method Detail

setValue

public void setValue(String value)
              throws ParameterException
Description copied from class: Option
Sets the value of the option.

Specified by:
setValue in class Option<File>
Parameters:
value - the option's value to be set
Throws:
ParameterException - if the given value is not a valid value for this option.
See Also:
Option.setValue(java.lang.String)

isValid

public boolean isValid(String value)
                throws ParameterException
Description copied from class: Option
Checks if the given argument is valid for this option.

Specified by:
isValid in class Option<File>
Parameters:
value - option value to be checked
Returns:
true, if the given value is valid for this option
Throws:
ParameterException - if the given value is not a valid value for this option.
See Also:
Option.isValid(java.lang.String)

getParameterType

protected String getParameterType()
Returns a string representation of the parameter's type.

Specified by:
getParameterType in class Parameter<File,Object>
Returns:
"<file_>"
See Also:
Parameter.getParameterType()

Release 0.1 (2008-07-10_1838)