|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.io.CommandLineParameter
public class CommandLineParameter
Represents the definition of a command line parameter, includes methods for checking and outputting data. A "\n" in the description denotes a line break.
Constructor Summary | |
---|---|
CommandLineParameter(java.lang.String name,
java.lang.String description)
initializes the parameter as flag |
|
CommandLineParameter(java.lang.String name,
java.lang.String description,
boolean hasArgument,
java.lang.String argDesc,
boolean optional)
initializes the parameter |
Method Summary | |
---|---|
java.lang.String |
getDescription()
returns the stored description |
int |
getIndention()
returns the indention for printing |
java.lang.String |
getName()
returns the name of the parameter |
boolean |
hasArgument()
returns whether the parameter has an argument or is just a flag |
boolean |
hasDescription()
returns whether a description for the parameter exists |
boolean |
isOptional()
returns whether the parameter is optional |
static void |
main(java.lang.String[] args)
for testing only |
void |
setIndention(int indention)
sets the indention for printing |
java.lang.String |
toString()
prints the parameter with description according to indention |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CommandLineParameter(java.lang.String name, java.lang.String description)
name
- the name of the parameterdescription
- the description of the parameterpublic CommandLineParameter(java.lang.String name, java.lang.String description, boolean hasArgument, java.lang.String argDesc, boolean optional)
name
- the name of the parameterdescription
- the description of the parameterhasArgument
- whether the parameter needs an argumentargDesc
- the description of the argument, "<arg>"
if NULL or ""optional
- whether the parameter it optionalMethod Detail |
---|
public java.lang.String getName()
public boolean hasDescription()
public java.lang.String getDescription()
public boolean hasArgument()
public boolean isOptional()
public void setIndention(int indention)
toString()
public int getIndention()
toString()
public java.lang.String toString()
toString
in class java.lang.Object
setIndention(int)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |