|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.ncl.cs.instantsoap.commandlineprocessor.commandLine.Argument<Value>
uk.ac.ncl.cs.instantsoap.commandlineprocessor.commandLine.Option<Value>
public class Option<Value>
Command-line option. This is composed of a name, and (possibly zero) values.
Either the letter or longName parameter must be non-null. If both are provided, then one will be chosen according to the commandline hints. In a command liketail -f, the option is f. In
a command like tar -f foo.tar, the option name is f
and the values list contains the single value foo.tar.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class uk.ac.ncl.cs.instantsoap.commandlineprocessor.commandLine.Argument |
|---|
Argument.ArgumentVisitor<Value> |
| Constructor Summary | |
|---|---|
Option()
Create a new option with an empty list of values. |
|
Option(String letter,
String name,
List<Value> values)
Create a new option with the specified properties. |
|
Option(String letter,
String name,
Value... values)
Create a new option with the specified properties. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
String |
getLetter()
Get the short name of this option. |
String |
getLongName()
Get the long name of this option. |
List<Value> |
getValues()
Get the value list. |
int |
hashCode()
|
void |
setLetter(String letter)
Set the short-name of this option. |
void |
setLongName(String longName)
Set the long name of this option. |
void |
setValues(List<Value> values)
Set the value list. |
String |
toString()
|
void |
visit(Argument.ArgumentVisitor<Value> valueArgumentVisitor)
Visit this argument, triggering the handle method of the visitor specific to the concrete class of the argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Option()
public Option(String letter,
String name,
List<Value> values)
letter - the short name (usually a single letter)name - the long namevalues - the List of Values
public Option(String letter,
String name,
Value... values)
letter - the short name (usually a single letter)name - the long namevalues - the Values| Method Detail |
|---|
public void visit(Argument.ArgumentVisitor<Value> valueArgumentVisitor)
Argument
visit in class Argument<Value>valueArgumentVisitor - the argumentVisitor that should visit this argumentpublic String getLetter()
public void setLetter(String letter)
letter - the new short name, or null if no short-name should be usedpublic String getLongName()
public void setLongName(String longName)
longName - the new long name of this option, or null if no long name is providedpublic List<Value> getValues()
List of Values of this optionpublic void setValues(List<Value> values)
values - the List of Value of this optionpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||