|
MaltParser 1.4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.maltparser.core.options.option.Option
org.maltparser.core.options.option.EnumOption
public class EnumOption
An enumerate option is an option that can only contain string value, which is in the legal value set.
Field Summary |
---|
Fields inherited from class org.maltparser.core.options.option.Option |
---|
BOTH, NONE, PROCESS, SAVE, TRAIN |
Constructor Summary | |
---|---|
EnumOption(OptionGroup group,
String name,
String shortDescription,
String flag,
String usage)
Creates an enumerate option description |
Method Summary | |
---|---|
void |
addLegalValue(String value)
Adds a legal value without a description |
void |
addLegalValue(String value,
String desc)
Adds a legal value |
Object |
getDefaultValueObject()
Returns the object for the default value for option. |
String |
getDefaultValueString()
Returns a string representation of the default value. |
String |
getStringRepresentation(Object value)
Returns a string representation of the option value. |
Object |
getValueObject(String value)
Returns the corresponding object for the option value (specified as a string value). |
void |
setDefaultValue(String defaultValue)
Sets the default value for the option. |
String |
toString()
|
Methods inherited from class org.maltparser.core.options.option.Option |
---|
compareTo, getFlag, getGroup, getName, getShortDescription, getUsage, isAmbiguous, setAmbiguous, setFlag, setGroup, setName, setShortDescription, setUsage, setUsage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EnumOption(OptionGroup group, String name, String shortDescription, String flag, String usage) throws MaltChainedException
group
- a reference to the option group.name
- the name of the option.shortDescription
- a short description of the option.flag
- a short string that can be used in the command line.usage
- a string that explains the usage of the option.
OptionException
MaltChainedException
Method Detail |
---|
public Object getValueObject(String value) throws MaltChainedException
Option
getValueObject
in class Option
value
- the string option value
OptionException
MaltChainedException
public Object getDefaultValueObject() throws MaltChainedException
Option
getDefaultValueObject
in class Option
OptionException
MaltChainedException
public String getDefaultValueString()
Option
getDefaultValueString
in class Option
public void setDefaultValue(String defaultValue) throws MaltChainedException
Option
setDefaultValue
in class Option
defaultValue
- the string default value
OptionException
MaltChainedException
public void addLegalValue(String value, String desc) throws MaltChainedException
value
- a legal value namedesc
- a short description of the legal value
OptionException
MaltChainedException
public void addLegalValue(String value) throws MaltChainedException
value
- a legal value name
OptionException
MaltChainedException
public String getStringRepresentation(Object value)
Option
getStringRepresentation
in class Option
value
- an option value object
public String toString()
toString
in class Option
|
MaltParser 1.4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |