Package elki.utilities.optionhandling
Class OptionUtil
- java.lang.Object
-
- elki.utilities.optionhandling.OptionUtil
-
public final class OptionUtil extends java.lang.Object
Utility functions related to Option handling.- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Modifier Constructor Description private
OptionUtil()
Fake constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringBuilder
describeParameterizable(java.lang.StringBuilder buf, java.lang.Class<?> pcls, int width)
Format a description of a Parameterizable (including recursive options).static void
formatForConsole(java.lang.StringBuilder buf, int width, java.util.Collection<TrackedParameter> options)
Format a list of options (and associated owning objects) for console help output.static java.lang.String
getFullDescription(Parameter<?> param)
Format a parameter description.private static void
println(java.lang.StringBuilder buf, int width, java.lang.String data)
Simple writing helper with no indentation.
-
-
-
Method Detail
-
formatForConsole
public static void formatForConsole(java.lang.StringBuilder buf, int width, java.util.Collection<TrackedParameter> options)
Format a list of options (and associated owning objects) for console help output.- Parameters:
buf
- Serialization bufferwidth
- Screen widthoptions
- List of options
-
getFullDescription
public static java.lang.String getFullDescription(Parameter<?> param)
Format a parameter description.- Parameters:
param
- Parameter- Returns:
- Parameter description
-
println
private static void println(java.lang.StringBuilder buf, int width, java.lang.String data)
Simple writing helper with no indentation.- Parameters:
buf
- Buffer to write towidth
- Width to use for linewrapsdata
- Data to write.
-
describeParameterizable
public static java.lang.StringBuilder describeParameterizable(java.lang.StringBuilder buf, java.lang.Class<?> pcls, int width) throws ClassInstantiationException
Format a description of a Parameterizable (including recursive options).- Parameters:
buf
- Buffer to append to.pcls
- Parameterizable class to describewidth
- Width- Returns:
- Formatted description
- Throws:
ClassInstantiationException
-
-