Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.Option<Boolean>
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.Flag

public class Flag
extends Option<Boolean>

Option class specifying a flag object.

A flag object is optional parameter which can be set (value "true") or not (value "false").

Author:
Steffi Wanka

Field Summary
static String NOT_SET
          Constant indicating that the flag is not set.
static String SET
          Constant indicating that the flag is set.
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.Option
optionid, shortDescription, value
 
Constructor Summary
Flag(OptionID optionID)
          Constructs a flag object with the given optionID.
 
Method Summary
 String getFullDescription()
          Returns the short description of this flag.
 String getSyntax()
          A flag has no syntax, since it doesn't take extra options
 boolean isSet()
          Returns true if the flag is set, false otherwise.
 boolean isValid(String value)
          Checks if the given argument is valid for this option.
 void setValue(boolean value)
          Specifies if the flag is set or not.
 void setValue(String value)
          Specifies if the flag is set or not.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.Option
getName, getOptionID, getShortDescription, getValue, setShortDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET

public static final String SET
Constant indicating that the flag is set.

See Also:
Constant Field Values

NOT_SET

public static final String NOT_SET
Constant indicating that the flag is not set.

See Also:
Constant Field Values
Constructor Detail

Flag

public Flag(OptionID optionID)
Constructs a flag object with the given optionID.

If the flag is not set its value is "false".

Parameters:
optionID - the unique id of the option
Method Detail

getFullDescription

public String getFullDescription()
Returns the short description of this flag.

Specified by:
getFullDescription in class Option<Boolean>
Returns:
the short description of this flag

isSet

public boolean isSet()
Returns true if the flag is set, false otherwise.

Specified by:
isSet in class Option<Boolean>
Returns:
true if the value of the option is set, false otherwise.

setValue

public void setValue(String value)
              throws ParameterException
Specifies if the flag is set or not.

The given value should be either SET or NOT_SET.

Specified by:
setValue in class Option<Boolean>
Parameters:
value - the option's value to be set
Throws:
ParameterException - if the given value is not a valid value for this option.

setValue

public void setValue(boolean value)
Specifies if the flag is set or not.

Parameters:
value - true, if the flag is set, false otherwise

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<Boolean>
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.

getSyntax

public String getSyntax()
A flag has no syntax, since it doesn't take extra options

Specified by:
getSyntax in class Option<Boolean>
Returns:
a string representation of the parameter's type

Release 0.2 (2009-07-06_1820)