ds.ov2.util
Class Value_option<E>

java.lang.Object
  extended by ds.ov2.util.Option
      extended by ds.ov2.util.Value_option<E>

public class Value_option<E>
extends Option

Command line switch which sets a reference to a certain value.

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<E> ref
          The reference to set.
private  E value
          The value to store in ref when the option is found.
 
Fields inherited from class ds.ov2.util.Option
argument, explanation, option
 
Constructor Summary
Value_option(String option, Reference<E> ref, E value, String explanation)
          Construct a value option.
 
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 final Reference<E> ref
The reference to set.


value

private final E value
The value to store in ref when the option is found.

Constructor Detail

Value_option

public Value_option(String option,
                    Reference<E> ref,
                    E value,
                    String explanation)
Construct a value option. When found on the command line, the reference ref will be set to the specified value.

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

matched

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

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