|
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.OptionManager
public class OptionManager
Option Manager is the management class for all option handling. All queries and manipulations of an option or an option value should go through this class.
Field Summary | |
---|---|
static int |
DEFAULTVALUE
|
Method Summary | |
---|---|
void |
generateMaps()
Creates several option maps for fast access to individual options. |
int |
getNumberOfOptionValues(int containerIndex)
Returns the number of option values for a particular option container. |
Set<Integer> |
getOptionContainerIndices()
Returns a sorted set of container names. |
Object |
getOptionDefaultValue(String optiongroup,
String optionname)
|
OptionDescriptions |
getOptionDescriptions()
Returns the option description |
Object |
getOptionValue(int containerIndex,
String optiongroup,
String optionname)
Returns the option value for an option that is specified by the option group name and option name. |
Object |
getOptionValueNoDefault(int containerIndex,
String optiongroup,
String optionname)
|
String |
getOptionValueString(int containerIndex,
String optiongroup,
String optionname)
Returns a string representation of the option value for an option that is specified by the option group name and the option name. |
String |
getOptionValueStringNoDefault(int containerIndex,
String optiongroup,
String optionname)
|
static OptionManager |
instance()
Returns a reference to the single instance. |
void |
loadOptionDescriptionFile()
Loads the option description file /appdata/options.xml |
void |
loadOptionDescriptionFile(URL url)
Loads the option description file |
void |
loadOptions(int containerIndex,
InputStreamReader isr)
Loads the saved options (options that are marked with usage=Option.SAVE ). |
void |
loadOptions(int containerIndex,
String fileName)
Loads the saved options (options that are marked with usage=save ). |
void |
overloadOptionValue(int containerIndex,
String optiongroup,
String optionname,
String value)
Overloads the option value specified by the container index, the option group name, the option name. |
boolean |
parseCommandLine(String[] args,
int containerIndex)
Parses the command line arguments. |
boolean |
parseCommandLine(String argString,
int containerIndex)
|
void |
parseOptionInstanceXMLfile(String fileName)
Parses the option file for option values. |
void |
saveOptions(int containerIndex,
OutputStreamWriter osw)
Saves all options that are marked as usage=Option.SAVE for a particular option container. |
void |
saveOptions(int containerIndex,
String fileName)
Saves all options that are marked as usage=Option.SAVE for a particular option container. |
void |
saveOptions(OutputStreamWriter osw)
Saves all options that are marked as usage=Option.SAVE |
void |
saveOptions(String fileName)
Saves all options that are marked as usage=Option.SAVE |
String |
toString()
|
String |
toStringPrettyValues(int containerIndex,
HashSet<String> excludeGroups)
Returns a string representation of all option value, except the options in a option group specified by the excludeGroup argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULTVALUE
Method Detail |
---|
public static OptionManager instance()
public void loadOptionDescriptionFile() throws MaltChainedException
/appdata/options.xml
MaltChainedException
public void loadOptionDescriptionFile(URL url) throws MaltChainedException
url
- URL of the option description file
MaltChainedException
public OptionDescriptions getOptionDescriptions()
public Object getOptionValue(int containerIndex, String optiongroup, String optionname) throws MaltChainedException
containerIndex
- The index of the option container (0..n and -1 is default values).optiongroup
- The name of the option group.optionname
- The name of the option.
OptionException
MaltChainedException
public Object getOptionDefaultValue(String optiongroup, String optionname) throws MaltChainedException
MaltChainedException
public Object getOptionValueNoDefault(int containerIndex, String optiongroup, String optionname) throws MaltChainedException
MaltChainedException
public String getOptionValueString(int containerIndex, String optiongroup, String optionname) throws MaltChainedException
containerIndex
- The index of the option container (0..n and -1 is default values).optiongroup
- The name of the option group.optionname
- The name of the option.
MaltChainedException
public String getOptionValueStringNoDefault(int containerIndex, String optiongroup, String optionname) throws MaltChainedException
MaltChainedException
public void overloadOptionValue(int containerIndex, String optiongroup, String optionname, String value) throws MaltChainedException
containerIndex
- the index of the option container (0..n and -1 is default values).optiongroup
- the name of the option group.optionname
- the name of the option.value
- the option value that should replace the current option value.
MaltChainedException
public int getNumberOfOptionValues(int containerIndex)
containerIndex
- The index of the option container (0..n).
public Set<Integer> getOptionContainerIndices()
public void loadOptions(int containerIndex, String fileName) throws MaltChainedException
usage=save
).
fileName
- The path to the file where to load the saved options.
MaltChainedException
public void loadOptions(int containerIndex, InputStreamReader isr) throws MaltChainedException
usage=Option.SAVE
).
isr
- the input stream reader of the saved options file.
MaltChainedException
public void saveOptions(String fileName) throws MaltChainedException
usage=Option.SAVE
fileName
- The path to the file where the saveOption should by saved.
MaltChainedException
public void saveOptions(OutputStreamWriter osw) throws MaltChainedException
usage=Option.SAVE
osw
- the output stream writer of the saved option file
MaltChainedException
public void saveOptions(int containerIndex, String fileName) throws MaltChainedException
containerIndex
- The index of the option container (0..n).fileName
- The path to the file where the saveOption should by saved.
MaltChainedException
public void saveOptions(int containerIndex, OutputStreamWriter osw) throws MaltChainedException
containerIndex
- The index of the option container (0..n).osw
- the output stream writer of the saved option file
MaltChainedException
public void generateMaps() throws MaltChainedException
OptionException
MaltChainedException
public boolean parseCommandLine(String argString, int containerIndex) throws MaltChainedException
MaltChainedException
public boolean parseCommandLine(String[] args, int containerIndex) throws MaltChainedException
args
- An array of arguments that are supplied when starting the application.
OptionException
MaltChainedException
public void parseOptionInstanceXMLfile(String fileName) throws MaltChainedException
fileName
- The option file name (must be a xml file).
OptionException
MaltChainedException
public String toStringPrettyValues(int containerIndex, HashSet<String> excludeGroups) throws MaltChainedException
containerIndex
- The index of the option container (0..n and -1 is default values).excludeGroups
- a set of option group names that should by excluded in the string representation
MaltChainedException
public String toString()
toString
in class Object
|
MaltParser 1.4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |