ds.ov2.util
Class Bool_option

java.lang.Object
  extended by ds.ov2.util.Option
      extended by ds.ov2.util.Bool_option

public class Bool_option
extends Option

Boolean command line switch that sets a boolean Reference to true if found on the command line.

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
Hendrik Tews
Version:
$Revision: 1.1 $
Last Commit:
$Date: 2009-06-02 09:56:03 $ by $Author: tews $

Field Summary
private  Reference<Boolean> ref
          Reference to set to true when the option occured.
 
Fields inherited from class ds.ov2.util.Option
argument, explanation, option
 
Constructor Summary
Bool_option(String option, Reference<Boolean> ref, String explanation)
          Construct a simple command line switch.
 
Method Summary
 void matched(Commandline cl)
          Called when the option is recognized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

private Reference<Boolean> ref
Reference to set to true when the option occured.

Constructor Detail

Bool_option

public Bool_option(String option,
                   Reference<Boolean> ref,
                   String explanation)
Construct a simple command line switch. When found on the command line, the reference ref will be set to true.

Parameters:
option - the literal option string as it will appear on the command line
ref - the reference to be switched to true
explanation - explanation for the usage information
Method Detail

matched

public void matched(Commandline cl)
Called when the option is recognized. Sets the boolean reference ref to true.

Specified by:
matched in class Option
Parameters:
cl - command line instance