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
Class OptionContainer

    java.lang.Object
      org.maltparser.core.options.OptionContainer

All Implemented Interfaces:
  Comparable<OptionContainer>

    public class OptionContainer

extends Object
implements Comparable<OptionContainer>

An option container stores the option values for one instance usage. For example, a single malt configuration there will only be one option container, but for an ensemble parser there could be several option containers. There are four types internal option container:

- SAVEDOPTION, contains option values load from the saved option file.
- DEPENDENCIES_RESOLVED, contains option values that overload option values in COMMANDLINE and OPTIONFILE due to dependencies with other options.
- COMMANDLINE, contains option values that are read from the command-line prompt.
- OPTIONFILE, contains option values that are read from the option file.

These internal option containers have following priority: SAVEDOPTION, DEPENDENCIES_RESOLVED, COMMANDLINE, OPTIONFILE. If an option cannot be found in the SAVEDOPTION internal option container it will continue to look in the DEPENDENCIES_RESOLVED internal option container and and so fourth. If the option value cannot be found in none of the internal option container, the option manager uses the default option value provided by the option description.

Since:
  1.0
Author:
  Johan Hall

Field Summary
`static int` | `COMMANDLINE`
`static int` | `DEPENDENCIES_RESOLVED`
`static int` | `OPTIONFILE`
`static int` | `SAVEDOPTION`

Constructor Summary
`OptionContainer(int index)` Creates an option container

Method Summary
`void` | `addOptionValue(int type, Option option, Object value)` Adds an option value to an option to one of the internal option container specified by the type.
`int` | `compareTo(OptionContainer that)`
`boolean` | `contains(int type, Option option)` Returns true if the option is present in the specified internal option container, otherwise false.
`int` | `getIndex()` Returns the option container index.
`int` | `getNumberOfOptionValues()` Returns the number of option values amongst all internal option containers.
`Object` | `getOptionValue(Option option)` Returns the option value object for the option.
`String` | `getOptionValueString(Option option)` Returns a string representation of the option value for the specified option.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### SAVEDOPTION

    public static final int SAVEDOPTION

See Also:
  Constant Field Values

### DEPENDENCIES_RESOLVED

    public static final int DEPENDENCIES_RESOLVED

See Also:
  Constant Field Values

### COMMANDLINE

    public static final int COMMANDLINE

See Also:
  Constant Field Values

### OPTIONFILE

    public static final int OPTIONFILE

See Also:
  Constant Field Values

Constructor Detail

### OptionContainer

    public OptionContainer(int index)
                    throws OptionException

  Creates an option container

  Parameters:
    `index` - The index of the option container (0..n).
  Throws:
    `OptionException`

Method Detail

### addOptionValue

    public void addOptionValue(int type,
                               Option option,
                               Object value)
                        throws OptionException

  Adds an option value to an option to one of the internal option container specified by the type.

  Parameters:
    `type` - the internal option container
    `option` - the option object
    `value` - the option value object
  Throws:
    `OptionException`

### getOptionValue

    public Object getOptionValue(Option option)

  Returns the option value object for the option. It uses the priority amongst the internal option containers.

  Parameters:
    `option` - the option object
  Returns:
    the option value object

### getOptionValueString

    public String getOptionValueString(Option option)

  Returns a string representation of the option value for the specified option. It uses the priority amongst the internal option containers.

  Parameters:
    `option` - the option object
  Returns:
    a string representation of the option value

### contains

    public boolean contains(int type,
                            Option option)
                     throws OptionException

  Returns true if the option is present in the specified internal option container, otherwise false.

  Parameters:
    `type` - the internal option container
    `option` - the option object
  Returns:
    true if the option is present in the specified internal option container, otherwise false
  Throws:
    `OptionException`

### getNumberOfOptionValues

    public int getNumberOfOptionValues()

  Returns the number of option values amongst all internal option containers.

  Returns:
    the number of option values amongst all internal option containers

### getIndex

    public int getIndex()

  Returns the option container index.

  Returns:
    the option container index

### compareTo

    public int compareTo(OptionContainer that)

  Specified by:
    `compareTo` in interface `Comparable<OptionContainer>`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

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.