EnumOption (MaltParser 1.4.1)
Date: 2010-07-15

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MaltParser 1.4.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.maltparser.core.options.option
Class EnumOption

    java.lang.Object
      org.maltparser.core.options.option.Option
          org.maltparser.core.options.option.EnumOption

All Implemented Interfaces:
  Comparable<Option>

    public class EnumOption

extends Option

An enumerate option is an option that can only contain string value, which is in the legal value set.

Since:
  1.0
Author:
  Johan Hall

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

### EnumOption

    public EnumOption(OptionGroup group,
                      String name,
                      String shortDescription,
                      String flag,
                      String usage)
               throws MaltChainedException

  Creates an enumerate option description

  Parameters:
    `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.
  Throws:
    `OptionException`
    `MaltChainedException`

Method Detail

### getValueObject

    public Object getValueObject(String value)
                          throws MaltChainedException

  Description copied from class: `Option`
  Returns the corresponding object for the option value (specified as a string value).

  Specified by:
    `getValueObject` in class `Option`
  Parameters:
    `value` - the string option value
  Returns:
    the corresponding object for the option value (specified as a string value).
  Throws:
    `OptionException`
    `MaltChainedException`

### getDefaultValueObject

    public Object getDefaultValueObject()
                                 throws MaltChainedException

  Description copied from class: `Option`
  Returns the object for the default value for option.

  Specified by:
    `getDefaultValueObject` in class `Option`
  Returns:
    the object for the default value for option.
  Throws:
    `OptionException`
    `MaltChainedException`

### getDefaultValueString

    public String getDefaultValueString()

  Description copied from class: `Option`
  Returns a string representation of the default value.

  Specified by:
    `getDefaultValueString` in class `Option`
  Returns:
    a string representation of the default value

### setDefaultValue

    public void setDefaultValue(String defaultValue)
                         throws MaltChainedException

  Description copied from class: `Option`
  Sets the default value for the option.

  Specified by:
    `setDefaultValue` in class `Option`
  Parameters:
    `defaultValue` - the string default value
  Throws:
    `OptionException`
    `MaltChainedException`

### addLegalValue

    public void addLegalValue(String value,
                              String desc)
                       throws MaltChainedException

  Adds a legal value

  Parameters:
    `value` - a legal value name
    `desc` - a short description of the legal value
  Throws:
    `OptionException`
    `MaltChainedException`

### addLegalValue

    public void addLegalValue(String value)
                       throws MaltChainedException

  Adds a legal value without a description

  Parameters:
    `value` - a legal value name
  Throws:
    `OptionException`
    `MaltChainedException`

### getStringRepresentation

    public String getStringRepresentation(Object value)

  Description copied from class: `Option`
  Returns a string representation of the option value.

  Specified by:
    `getStringRepresentation` in class `Option`
  Parameters:
    `value` - an option value object
  Returns:
    a string representation of the option value, if the option value could not be found null is returned.

### toString

    public String toString()

  Overrides:
    `toString` in class `Option`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MaltParser 1.4.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.