FreeHEP API
Version current

org.freehep.util.argv
Class BooleanOption

java.lang.Object
  extended byorg.freehep.util.argv.BooleanOption
All Implemented Interfaces:
Option

public class BooleanOption
extends Object
implements Option

A Boolean option for use with ArgumentParser. It is false unless the flag is found in the command line, in which case it is true.

Source Code:
BooleanOption.java

Constructor Summary
BooleanOption(String flag, String description)
           
BooleanOption(String flag, String description, boolean bailOut)
           
BooleanOption(String flag, String shortCut, String description)
           
BooleanOption(String flag, String shortCut, String description, boolean bailOut)
           
 
Method Summary
 String getOption()
          Must return the flag and parameters of this option.
 String getUsage()
          Must return a description of the usage of this option.
 boolean getValue()
          Returns the boolean value of this option.
 int parse(List values)
          Parsing method invoked by ArgumentParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanOption

public BooleanOption(String flag,
                     String description)

BooleanOption

public BooleanOption(String flag,
                     String description,
                     boolean bailOut)

BooleanOption

public BooleanOption(String flag,
                     String shortCut,
                     String description)

BooleanOption

public BooleanOption(String flag,
                     String shortCut,
                     String description,
                     boolean bailOut)
Method Detail

getValue

public boolean getValue()
Returns the boolean value of this option. By default, the option's value is false; it is true if the flag was found when the command line was parsed.


parse

public int parse(List values)
          throws BailOutException
Parsing method invoked by ArgumentParser.

Specified by:
parse in interface Option
Throws:
BailOutException

getOption

public String getOption()
Description copied from interface: Option
Must return the flag and parameters of this option.

Specified by:
getOption in interface Option

getUsage

public String getUsage()
Description copied from interface: Option
Must return a description of the usage of this option.

Specified by:
getUsage in interface Option

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.