Package cc.mallet.util
Class CommandOption
- java.lang.Object
-
- cc.mallet.util.CommandOption
-
- Direct Known Subclasses:
CommandOption.Boolean,CommandOption.Double,CommandOption.DoubleArray,CommandOption.File,CommandOption.Integer,CommandOption.IntegerArray,CommandOption.Object,CommandOption.Set,CommandOption.SpacedStrings,CommandOption.String
public abstract class CommandOption extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommandOption.Booleanstatic classCommandOption.Doublestatic classCommandOption.DoubleArraystatic classCommandOption.Filestatic classCommandOption.Integerstatic classCommandOption.IntegerArraystatic classCommandOption.Liststatic interfaceCommandOption.ListProvidingFor objects that can provide CommandOption.List's (which can be merged into other lists.static classCommandOption.Objectstatic classCommandOption.ObjectFromBeanstatic classCommandOption.Setstatic classCommandOption.SpacedStringsstatic classCommandOption.String
-
Constructor Summary
Constructors Constructor Description CommandOption(java.lang.Class owner, java.lang.String name, java.lang.String argName, java.lang.Class argType, boolean argRequired, java.lang.String shortdoc)Deprecated.CommandOption(java.lang.Class owner, java.lang.String name, java.lang.String argName, java.lang.Class argType, boolean argRequired, java.lang.String shortdoc, java.lang.String longdoc)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.StringdefaultValueToString()java.lang.StringgetFullName()static BshInterpretergetInterpreter()static CommandOption.ListgetList(java.lang.Class owner)java.lang.StringgetName()voidparseArg(java.lang.String arg)intparseArg(java.lang.String[] args, int index)Called after this CommandOption matches an argument.voidpostParsing(CommandOption.List list)To be overridden by subclasses; "list" is the the CommandOption.List that called this optionstatic voidprintOptionValues(java.lang.Class owner)static java.lang.String[]process(java.lang.Class owner, java.lang.String[] args)intprocess(java.lang.String[] args, int index)Give this CommandOption the opportunity to process the index'th argument in args.static voidsetSummary(java.lang.Class owner, java.lang.String summary)abstract java.lang.StringvalueToString()booleanwasInvoked()Return true is this CommandOption was matched by one of the processed arguments.
-
-
-
Constructor Detail
-
CommandOption
public CommandOption(java.lang.Class owner, java.lang.String name, java.lang.String argName, java.lang.Class argType, boolean argRequired, java.lang.String shortdoc, java.lang.String longdoc)
-
CommandOption
@Deprecated public CommandOption(java.lang.Class owner, java.lang.String name, java.lang.String argName, java.lang.Class argType, boolean argRequired, java.lang.String shortdoc)Deprecated.
-
-
Method Detail
-
process
public int process(java.lang.String[] args, int index)Give this CommandOption the opportunity to process the index'th argument in args. Return the next unprocessed index.
-
getInterpreter
public static BshInterpreter getInterpreter()
-
process
public static java.lang.String[] process(java.lang.Class owner, java.lang.String[] args)
-
getList
public static CommandOption.List getList(java.lang.Class owner)
-
setSummary
public static void setSummary(java.lang.Class owner, java.lang.String summary)
-
getFullName
public java.lang.String getFullName()
-
getName
public java.lang.String getName()
-
defaultValueToString
public abstract java.lang.String defaultValueToString()
-
valueToString
public abstract java.lang.String valueToString()
-
wasInvoked
public boolean wasInvoked()
Return true is this CommandOption was matched by one of the processed arguments.
-
parseArg
public int parseArg(java.lang.String[] args, int index)Called after this CommandOption matches an argument. The default implementation simply calls parseArg(String), and returns index+1; unless index is negative, in which case it calls parseArg((String)null) and returns index.
-
parseArg
public void parseArg(java.lang.String arg)
-
postParsing
public void postParsing(CommandOption.List list)
To be overridden by subclasses; "list" is the the CommandOption.List that called this option
-
printOptionValues
public static void printOptionValues(java.lang.Class owner)
-
-