|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.classpath.tools.getopt.OptionGroup
public class OptionGroup
An option group holds a collection of Options. It also has a name. Option groups are primarily useful for grouping help output.
Field Summary | |
---|---|
private static String |
FILLER
An 80-character string of whitespaces to use as a source for padding. |
private String |
name
|
(package private) ArrayList |
options
|
Constructor Summary | |
---|---|
OptionGroup()
Create a new nameless option group. |
|
OptionGroup(String name)
Create a new option group with the indicated name. |
Method Summary | |
---|---|
void |
add(Option opt)
Add an option to this option group. |
protected static void |
formatText(PrintStream out,
String text,
int leftMargin)
Print a designated text to a PrintStream , eventually wrapping the
lines of text so as to ensure that the width of each line does not overflow
Parser.MAX_LINE_LENGTH columns. |
protected static void |
formatText(PrintStream out,
String text,
int leftMargin,
Locale aLocale)
Similar to the method with the same name and three arguments, except that the caller MUST specify a non-null Locale instance. |
void |
printHelp(PrintStream out,
boolean longOnly)
Print the help output for this option group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String FILLER
private String name
ArrayList options
Constructor Detail |
---|
OptionGroup()
public OptionGroup(String name)
name
- the nameMethod Detail |
---|
protected static void formatText(PrintStream out, String text, int leftMargin)
PrintStream
, eventually wrapping the
lines of text so as to ensure that the width of each line does not overflow
Parser.MAX_LINE_LENGTH
columns. The line-wrapping is done with a
BreakIterator
using the default Locale
.
The text to print may contain \n
characters. This method will
force a line-break for each such character.
out
- the PrintStream
destination of the formatted text.text
- the text to print.leftMargin
- a positive value indicating the column position of the
start of the first line. Continuation lines, if they exist, are
printed starting at leftMargin + 2
as per GNU
convention.Parser.MAX_LINE_LENGTH
protected static void formatText(PrintStream out, String text, int leftMargin, Locale aLocale)
Locale
instance.
Print a designated text to a PrintStream
, eventually wrapping the
lines of text so as to ensure that the width of each line does not overflow
Parser.MAX_LINE_LENGTH
columns. The line-wrapping is done with a
BreakIterator
using the designated Locale
.
The text to print may contain \n
characters. This method will
force a line-break for each such character.
out
- the PrintStream
destination of the formatted text.text
- the text to print.leftMargin
- a positive value indicating the column position of the
start of the first line. Continuation lines, if they exist, are
printed starting at leftMargin + 2
as per GNU
convention.aLocale
- the Locale
instance to use when constructing the
BreakIterator
.Parser.MAX_LINE_LENGTH
public void add(Option opt)
opt
- the option to addpublic void printHelp(PrintStream out, boolean longOnly)
out
- the stream to which to print
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |