com.charliedog.argv
Class PairArgument

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

public class PairArgument
extends java.lang.Object
implements Argument

A Pair argument, for use with ArgumentParser. A Pair argument has two values, a source and a destination, and is useful for programs which translate (or otherwise process) some input to produce some output. Source and destination could be, for example, either file formats or file names. On the command line, a translate argument consists of a flag followed by the source and destination arguments, in that order:

   -<flag> <source> <dest>
 


Constructor Summary
PairArgument(java.lang.String flag, java.lang.String description)
          Initialize a new Pair argument.
 
Method Summary
 java.lang.String getDestination()
          Return the destination value of this argument, which may be null.
 java.lang.String getSource()
          Return the source value of this argument, which may be null.
 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

PairArgument

public PairArgument(java.lang.String flag,
                    java.lang.String description)
Initialize a new Pair argument.

Method Detail

getSource

public java.lang.String getSource()
Return the source value of this argument, which may be null.


getDestination

public java.lang.String getDestination()
Return the destination value of this argument, which may be 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