public class OptionContainer extends java.lang.Object implements java.lang.Comparable<OptionContainer>
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.
Modifier and Type | Field and Description |
---|---|
static int |
COMMANDLINE |
static int |
DEPENDENCIES_RESOLVED |
static int |
OPTIONFILE |
static int |
SAVEDOPTION |
Constructor and Description |
---|
OptionContainer(int index)
Creates an option container
|
Modifier and Type | Method and Description |
---|---|
protected void |
addOptionValue(int type,
Option option,
java.lang.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.
|
java.lang.Object |
getOptionValue(Option option)
Returns the option value object for the option.
|
java.lang.String |
getOptionValueString(Option option)
Returns a string representation of the option value for the specified option.
|
java.lang.String |
toString() |
public static final int SAVEDOPTION
public static final int DEPENDENCIES_RESOLVED
public static final int COMMANDLINE
public static final int OPTIONFILE
public OptionContainer(int index) throws OptionException
index
- The index of the option container (0..n).OptionException
protected void addOptionValue(int type, Option option, java.lang.Object value) throws OptionException
type
- the internal option containeroption
- the option objectvalue
- the option value objectOptionException
public java.lang.Object getOptionValue(Option option)
option
- the option objectpublic java.lang.String getOptionValueString(Option option)
option
- the option objectpublic boolean contains(int type, Option option) throws OptionException
type
- the internal option containeroption
- the option objectOptionException
public int getNumberOfOptionValues()
public int getIndex()
public int compareTo(OptionContainer that)
compareTo
in interface java.lang.Comparable<OptionContainer>
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.