|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jagatoo.commandline.ArgumentsRegistry
public class ArgumentsRegistry
Holds a distinct set of all known and valid arguments of a command line.
Constructor Summary | |
---|---|
ArgumentsRegistry(java.lang.String name)
Creates a new ArgumentsRegistry. |
|
ArgumentsRegistry(java.lang.String name,
java.lang.String headLine)
Creates a new ArgumentsRegistry. |
Method Summary | |
---|---|
void |
addArgument(Argument arg)
Adds a new argument. |
boolean |
contains(char shortName)
Checks whether an argument exists with the given short-name. |
boolean |
contains(java.lang.String longName)
Checks whether an argument exists with the given long-name. |
void |
dump()
Dumps all registered arguments to stdout with a maximum line width of 80. |
void |
dump(int maxLineWidth)
Dumps all registered arguments to stdout. |
void |
dump(int maxLineWidth,
java.io.PrintStream out)
Dumps all registered arguments. |
void |
dump(java.io.PrintStream out)
Dumps all registered arguments with a maximum line width of 80. |
Argument |
getArgument(char shortName)
Gets the argument corresponding to the given short-name. |
Argument |
getArgument(java.lang.String longName)
Gets the argument corresponding to the given long-name. |
java.lang.String |
getName()
Gets this registry's name. |
void |
removeArgument(Argument arg)
Removes an argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArgumentsRegistry(java.lang.String name, java.lang.String headLine)
name
- the name (used in the dump()
method.headLine
- if not null, the name is ignored in the dump()
method and this String is dumped first.public ArgumentsRegistry(java.lang.String name)
name
- the name (used in the dump()
method.Method Detail |
---|
public final java.lang.String getName()
public void addArgument(Argument arg)
arg
- public void removeArgument(Argument arg)
arg
- public final boolean contains(char shortName)
shortName
-
public final boolean contains(java.lang.String longName)
longName
-
public final Argument getArgument(char shortName)
shortName
-
public final Argument getArgument(java.lang.String longName)
longName
-
public void dump(int maxLineWidth, java.io.PrintStream out)
maxLineWidth
- out
- public final void dump(int maxLineWidth)
maxLineWidth
- public final void dump(java.io.PrintStream out)
out
- public final void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |