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

## avrora.util
Class Options

    java.lang.Object
      avrora.util.Options

public class Options
extends java.lang.Object

The `Options` class represents a collection of command line options and utility methods for parsing the command line. Very useful for getting cheap and powerful parsing of command line options.

Field Summary
`protected java.lang.String[]` | `arguments`
`protected java.lang.String` | `firstUnknownOption`
`protected java.util.HashMap` | `knownValues`
`protected java.util.HashMap` | `unknownValues`

Constructor Summary
`Options()`

Method Summary
`void` | `dump(java.lang.String title, Printer p)`
`java.util.Collection` | `getAllOptions()`
`java.lang.String[]` | `getArguments()`
`java.lang.String` | `getFirstUnknownOption()`
`Option` | `getOption(java.lang.String name)`
`java.lang.String` | `getOptionValue(java.lang.String name)`
`boolean` | `hasOption(java.lang.String name)`
`Option.Bool` | `newOption(java.lang.String name, boolean val, java.lang.String desc)`
`Option.Long` | `newOption(java.lang.String name, long val, java.lang.String desc)`
`Option.Str` | `newOption(java.lang.String name, java.lang.String val, java.lang.String desc)`
`Option.List` | `newOptionList(java.lang.String name, java.lang.String val, java.lang.String desc)`
`void` | `parseCommandLine(java.lang.String[] args)`
`protected void` | `parseOption(java.lang.String opt)`
`boolean` | `unknownOptions()`

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

Field Detail

### knownValues

    protected final java.util.HashMap knownValues

### unknownValues

    protected final java.util.HashMap unknownValues

### firstUnknownOption

    protected java.lang.String firstUnknownOption

### arguments

    protected java.lang.String[] arguments

Constructor Detail

### Options

    public Options()

Method Detail

### newOption

    public Option.Bool newOption(java.lang.String name,
                                 boolean val,
                                 java.lang.String desc)

### newOption

    public Option.Str newOption(java.lang.String name,
                                java.lang.String val,
                                java.lang.String desc)

### newOptionList

    public Option.List newOptionList(java.lang.String name,
                                     java.lang.String val,
                                     java.lang.String desc)

### newOption

    public Option.Long newOption(java.lang.String name,
                                 long val,
                                 java.lang.String desc)

### getOptionValue

    public java.lang.String getOptionValue(java.lang.String name)

### getOption

    public Option getOption(java.lang.String name)

### hasOption

    public boolean hasOption(java.lang.String name)

### getArguments

    public java.lang.String[] getArguments()

### unknownOptions

    public boolean unknownOptions()

### getFirstUnknownOption

    public java.lang.String getFirstUnknownOption()

### parseCommandLine

    public void parseCommandLine(java.lang.String[] args)

### parseOption

    protected void parseOption(java.lang.String opt)

### getAllOptions

    public java.util.Collection getAllOptions()

### dump

    public void dump(java.lang.String title,
                     Printer p)

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