Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.util
Class ArgParser.Arg

    java.lang.Object
      com.bbn.openmap.util.ArgParser.Arg

Direct Known Subclasses:
  ArgParser.HelpArg

Enclosing class:
  ArgParser

public class ArgParser.Arg
extends java.lang.Object

A default version of the Arg class used to represent options for the ArgParser to use.

Field Summary
`char` | `c`
`boolean` | `dashedArguments`
`java.lang.String` | `description`
`boolean` | `flagged`
`java.lang.String` | `name`
`int` | `numExpectedValues`
`java.lang.String[]` | `values`

Constructor Summary
`ArgParser.Arg(java.lang.String aName, java.lang.String desc)` Create an Arg with a name and help line description.
`ArgParser.Arg(java.lang.String aName, java.lang.String desc, int expectedNumberOfArguments)` Create an Arg with a name and help line description, along with a number of expected arguments to follow this option.
`ArgParser.Arg(java.lang.String aName, java.lang.String desc, int expectedNumberOfArguments, boolean expectDashedArguments)` Create an Arg with a name and help line description, along with a number of expected arguments to follow this option.

Method Summary
`boolean` | `is(java.lang.String arg, boolean allowAbbr)` Returns true if the atg string matches the name of the Arg, or, if allowAbbr is true, returns true if the arg length is one and it matches the first letter of the arg name.
`boolean` | `readArgs(java.lang.String[] argv, int argIndex)` Runs through the array of Strings, starting at the argIndex, and creates the values array from it.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### name

    public java.lang.String name

### description

    public java.lang.String description

### numExpectedValues

    public int numExpectedValues

### values

    public java.lang.String[] values

### c

    public char c

### flagged

    public boolean flagged

### dashedArguments

    public boolean dashedArguments

Constructor Detail

### ArgParser.Arg

    public ArgParser.Arg(java.lang.String aName,
                         java.lang.String desc)

  Create an Arg with a name and help line description.

### ArgParser.Arg

    public ArgParser.Arg(java.lang.String aName,
                         java.lang.String desc,
                         int expectedNumberOfArguments)

  Create an Arg with a name and help line description, along with a number of expected arguments to follow this option.

### ArgParser.Arg

    public ArgParser.Arg(java.lang.String aName,
                         java.lang.String desc,
                         int expectedNumberOfArguments,
                         boolean expectDashedArguments)

  Create an Arg with a name and help line description, along with a number of expected arguments to follow this option. Has an argument to not check for arguments that may start with dashes, in case one of the arguements may be a negative number.

Method Detail

### is

    public boolean is(java.lang.String arg,
                      boolean allowAbbr)

  Returns true if the atg string matches the name of the Arg, or, if allowAbbr is true, returns true if the arg length is one and it matches the first letter of the arg name.

### readArgs

    public boolean readArgs(java.lang.String[] argv,
                            int argIndex)
                     throws java.lang.ArrayIndexOutOfBoundsException,
                            java.lang.NegativeArraySizeException

  Runs through the array of Strings, starting at the argIndex, and creates the values array from it. Uses the expected number of arguments to tell when it's done. Returns true if everything happens as expected.

  Parameters:
    `argv` - the entire array passed to the parser.
    `argIndex` - the index of the first option argument value.
  Returns:
    true if what was read was what was expected.
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException`
    `java.lang.NegativeArraySizeException`

### toString

    public java.lang.String toString()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details