ds.ov2.util
Class Bool_int_option

java.lang.Object
  extended by ds.ov2.util.Option
      extended by ds.ov2.util.Int_option
          extended by ds.ov2.util.Bool_int_option

public class Bool_int_option
extends Int_option

Int_option that additionally sets a boolean reference to true.

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> bool_ref
          The boolean reference.
 
Fields inherited from class ds.ov2.util.Option
argument, explanation, option
 
Constructor Summary
Bool_int_option(String option, Reference<Boolean> bool_ref, Reference<Integer> int_ref, String argument, String explanation)
          Construct an bool-integer option.
 
Method Summary
 void matched(Commandline cl)
          Called when the option is recognized.
 
Methods inherited from class ds.ov2.util.Int_option
get_int_argument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bool_ref

private Reference<Boolean> bool_ref
The boolean reference.

Constructor Detail

Bool_int_option

public Bool_int_option(String option,
                       Reference<Boolean> bool_ref,
                       Reference<Integer> int_ref,
                       String argument,
                       String explanation)
Construct an bool-integer option. When found on the command line, the boolean reference will be set to true and the int reference will be set to the value of the next command line element.

Parameters:
option - the literal option string as it will appear on the command line
bool_ref - the boolean reference
int_ref - the int reference
argument - name of the argument for the explanation
explanation - explanation for the usage information
Method Detail

matched

public void matched(Commandline cl)
Called when the option is recognized. Converts the next command line element to an integer and puts it into the int reference. Additionally set the boolean reference to true. Prints an error and exits the program on any problem.

Overrides:
matched in class Int_option
Parameters:
cl - command line instance