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.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.Option<Boolean>
          extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.Flag
All Implemented Interfaces:
Loggable

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
name, shortDescription, value
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
Flag(OptionID optionID)
          Constructs a flag object with the given optionID.
Flag(String name, String description)
          Deprecated.  
 
Method Summary
 String getDescription()
          Returns the short description of this flag.
 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, getShortDescription, getValue, 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

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

Flag

@Deprecated
public Flag(String name,
                       String description)
Deprecated. 

Constructs a flag object with the given name and description.

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

Parameters:
name - the name of the flag.
description - the description of the flag.
Method Detail

getDescription

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

Specified by:
getDescription in class Option<Boolean>
Returns:
the short description of this flag
See Also:
Option.getDescription()

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.
See Also:
Option.isSet()

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.
See Also:
Option.setValue(java.lang.String)

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.
See Also:
Option.isValid(java.lang.String)

Release 0.1 (2008-07-10_1838)