cc.mallet.util
Class CommandOption

java.lang.Object
  extended by 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
static class CommandOption.Boolean
           
static class CommandOption.Double
           
static class CommandOption.DoubleArray
           
static class CommandOption.File
           
static class CommandOption.Integer
           
static class CommandOption.IntegerArray
           
static class CommandOption.List
           
static interface CommandOption.ListProviding
          For objects that can provide CommandOption.List's (which can be merged into other lists.
static class CommandOption.Object
           
static class CommandOption.ObjectFromBean
           
static class CommandOption.Set
           
static class CommandOption.SpacedStrings
           
static class CommandOption.String
           
 
Constructor Summary
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
abstract  java.lang.String defaultValueToString()
           
 java.lang.String getFullName()
           
static BshInterpreter getInterpreter()
           
static CommandOption.List getList(java.lang.Class owner)
           
 java.lang.String getName()
           
 void parseArg(java.lang.String arg)
           
 int parseArg(java.lang.String[] args, int index)
          Called after this CommandOption matches an argument.
 void postParsing(CommandOption.List list)
          To be overridden by subclasses; "list" is the the CommandOption.List that called this option
static void printOptionValues(java.lang.Class owner)
           
static java.lang.String[] process(java.lang.Class owner, java.lang.String[] args)
           
 int process(java.lang.String[] args, int index)
          Give this CommandOption the opportunity to process the index'th argument in args.
static void setSummary(java.lang.Class owner, java.lang.String summary)
           
abstract  java.lang.String valueToString()
           
 boolean wasInvoked()
          Return true is this CommandOption was matched by one of the processed arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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)