com.charliedog.argv
Class ListArgument

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

public class ListArgument
extends java.lang.Object
implements Argument

A List argument for use with ArgumentParser. A List argument consumes all values it sees in the command line arguments and returns them as a list. The order of the values is preserved. Because this argument consumes all available values, it should be registered as the last argument added to an ArgumentParser instance.


Constructor Summary
ListArgument(java.lang.String description)
          Initialize a new List argument with the given description.
 
Method Summary
 java.util.List getValue()
          Returns the list of values collected by 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

ListArgument

public ListArgument(java.lang.String description)
Initialize a new List argument with the given description.

Method Detail

getValue

public java.util.List getValue()
Returns the list of values collected by this argument. The list may be empty but is never null.


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