|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.utilities.optionhandling.OptionUtil
public final class OptionUtil
Utility functions related to Option handling.
Constructor Summary | |
---|---|
OptionUtil()
|
Method Summary | ||
---|---|---|
static void |
addFlag(List<String> parameters,
Flag flag)
Adds the specified flag to the beginning of the given parameter list. |
|
static void |
addFlag(List<String> parameters,
OptionID optionID)
Adds the specified optionID of a flag to the beginning of the given parameter list. |
|
static void |
addParameter(List<String> parameters,
OptionID optionID,
String value)
Adds the specified optionID and its value to the beginning of the given parameter list. |
|
static void |
addParameter(List<String> parameters,
Parameter<?,?> parameter,
String value)
Adds the specified parameter and the specified value to the beginning of the given parameter list. |
|
static String[] |
addParameter(String[] parameters,
OptionID optionID,
String value)
Adds the specified optionID and its value to the beginning of the given parameter array. |
|
static void |
addParameters(List<String> parameters,
Iterable<String> append)
Appends the given options to the parameter list. |
|
static void |
addParameters(List<String> parameters,
String[] append)
Appends the given options to the parameter list. |
|
static String |
describeParameterizable(Parameterizable p)
Produce a description of a Parameterizable instance (including recursive options). |
|
static StringBuffer |
describeParameterizable(StringBuffer buf,
Parameterizable p,
int width,
String indent)
Format a description of a Parameterizable (including recursive options). |
|
static void |
formatForConsole(StringBuffer buf,
int width,
String indent,
List<Pair<Parameterizable,Option<?>>> options)
Format a list of options (and associated owning objects) for console help output. |
|
static
|
optionsNamesToString(List<O> options)
Returns a string representation of the specified list of options containing the names of the options. |
|
static
|
optionsNamesToString(O[] options)
Returns a string representation of the specified list of options containing the names of the options. |
|
static List<String> |
parameterDifference(List<String> complete,
List<String> part)
Returns an array that contains all elements of the first parameter array that are not contained by the second parameter array. |
|
static
|
parameterNamesAndValuesToString(List<N> parameters)
Returns a string representation of the list of number parameters containing the names and the values of the parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OptionUtil()
Method Detail |
---|
public static void addFlag(List<String> parameters, Flag flag)
parameters
- the list of parametersflag
- the flag to be addedpublic static void addFlag(List<String> parameters, OptionID optionID)
parameters
- the list of parametersoptionID
- the optionID to be addedpublic static void addParameter(List<String> parameters, OptionID optionID, String value)
parameters
- the list of parametersoptionID
- the optionID of the parameter to be addedvalue
- the value of the parameter to be addedpublic static void addParameter(List<String> parameters, Parameter<?,?> parameter, String value)
parameters
- the list of parametersparameter
- the parameter to be addedvalue
- the value of the parameter to be addedpublic static String[] addParameter(String[] parameters, OptionID optionID, String value)
parameters
- the array of parametersoptionID
- the optionID to be addedvalue
- the value of the optionID to be added
parameters
and
the specified optionID
and its value
.public static void addParameters(List<String> parameters, Iterable<String> append)
parameters
- the list of parametersappend
- Parameters to append.public static void addParameters(List<String> parameters, String[] append)
parameters
- the list of parametersappend
- Parameters to append.public static <O extends Option<?>> String optionsNamesToString(List<O> options)
O
- Option typeoptions
- the list of options
public static <O extends Option<?>> String optionsNamesToString(O[] options)
O
- Option typeoptions
- the list of options
public static List<String> parameterDifference(List<String> complete, List<String> part) throws IllegalArgumentException
complete
- the complete arraypart
- an array that contains only elements of the first parameter array
IllegalArgumentException
- if the first array, complete
is not as long as
the second array, part
or the second,
part
, contains entries that are not contained
by the first, complete
public static <N extends NumberParameter<?>> String parameterNamesAndValuesToString(List<N> parameters)
N
- Parameter typeparameters
- the list of number parameters
public static void formatForConsole(StringBuffer buf, int width, String indent, List<Pair<Parameterizable,Option<?>>> options)
buf
- Serialization bufferwidth
- Screen widthindent
- Indentation stringoptions
- List of optionspublic static String describeParameterizable(Parameterizable p)
p
- Parameterizable to describe
public static StringBuffer describeParameterizable(StringBuffer buf, Parameterizable p, int width, String indent)
buf
- Buffer to append to.p
- Parameterizable to describewidth
- Widthindent
- Text indent
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |