|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.toronto.cs.util.Clapi.Opt
public abstract static class Clapi.Opt
Represents a command-line option.
This is the main deal: users of Clapi create instances of Opt subclasses, and ask the parser to parse. The subclasses of Opt are responsible for parsing their arguments and constructing the result data structure.
Constructor Summary | |
---|---|
Clapi.Opt(Clapi.OptSpec _spec)
|
Method Summary | |
---|---|
protected void |
checkArity(Clapi.OptResult result)
|
java.lang.Object |
get(Clapi.OptResult result)
|
abstract Clapi.ArgumentParser |
getArgumentParser()
|
java.lang.String |
getArgumentsSpec()
|
java.util.List |
getList(Clapi.OptResult result)
|
java.lang.Object[] |
getObjectArray(Clapi.OptResult result)
|
java.util.List |
getOptionSpecifiers()
Returns a list of strings containing human-readable descriptions of all the forms of this option. |
Clapi.OptSpec |
getSpec()
|
protected java.lang.String |
getToken(edu.toronto.cs.util.Clapi.TokenStream in)
Grab the given token. |
boolean |
isTerminal()
|
protected void |
parseArguments(edu.toronto.cs.util.Clapi.TokenStream in,
Clapi.OptResult optResult)
Parses the arguments for this option, adding them to the OptResult data structure passed in. |
void |
printArgumentsSpec(java.io.PrintWriter out)
|
java.lang.String |
tag()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Clapi.Opt(Clapi.OptSpec _spec)
Method Detail |
---|
public boolean isTerminal()
public Clapi.OptSpec getSpec()
public abstract Clapi.ArgumentParser getArgumentParser()
protected void parseArguments(edu.toronto.cs.util.Clapi.TokenStream in, Clapi.OptResult optResult) throws Clapi.OptParseException
Parses the arguments for this option, adding them to the OptResult data structure passed in.
Consumes tokens from the input stream.
Clapi.OptParseException
protected java.lang.String getToken(edu.toronto.cs.util.Clapi.TokenStream in) throws Clapi.OptParseException
Clapi.OptParseException
protected void checkArity(Clapi.OptResult result) throws Clapi.OptParseException
Clapi.OptParseException
public java.lang.Object get(Clapi.OptResult result)
public java.util.List getList(Clapi.OptResult result)
public java.lang.Object[] getObjectArray(Clapi.OptResult result)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String tag()
public java.util.List getOptionSpecifiers()
public java.lang.String getArgumentsSpec()
public void printArgumentsSpec(java.io.PrintWriter out)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |