com.charliedog.argv
Class BooleanArgument

java.lang.Object
  |
  +--com.charliedog.argv.BooleanArgument
All Implemented Interfaces:
Argument

public class BooleanArgument
extends java.lang.Object
implements Argument

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


Constructor Summary
BooleanArgument(java.lang.String flag, java.lang.String description)
          Construct a new boolean argument with the given flag and description.
 
Method Summary
 boolean getValue()
          Returns the boolean value of this argument.
 int parse(java.util.List values)
          Parsing method invoked by ArgumentParser.
 void printUsage(java.io.PrintWriter out)
          Usage method invoked by ArgumentParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanArgument

public BooleanArgument(java.lang.String flag,
                       java.lang.String description)
Construct a new boolean argument with the given flag and description.

Method Detail

getValue

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


parse

public int parse(java.util.List values)
Parsing method invoked by ArgumentParser.

Specified by:
parse in interface Argument

printUsage

public void printUsage(java.io.PrintWriter out)
Usage method invoked by ArgumentParser.

Specified by:
printUsage in interface Argument