|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.application.AbstractApplication
public abstract class AbstractApplication
AbstractApplication sets the values for flags verbose and help.
Any Wrapper class that makes use of these flags may extend this class. Beware to make correct use of parameter settings via optionHandler as commented with constructor and methods.
Nested Class Summary | |
---|---|
static class |
AbstractApplication.Parameterizer
Parameterization class. |
Field Summary | |
---|---|
static String |
INFORMATION
Information for citation and version. |
static OptionID |
INPUT_ID
Parameter that specifies the name of the input file. |
private static String |
NEWLINE
The newline string according to system. |
static OptionID |
OUTPUT_ID
Parameter that specifies the name of the output file. |
protected static Logging |
STATIC_LOGGER
We need a static logger in this class, for code used in "main" methods. |
private boolean |
verbose
Value of verbose flag. |
Constructor Summary | |
---|---|
AbstractApplication(boolean verbose)
Constructor. |
Method Summary | |
---|---|
boolean |
isVerbose()
Returns whether verbose messages should be printed while executing the application. |
private static void |
printDescription(Class<?> descriptionClass)
Print the description for the given parameter |
protected static void |
printErrorMessage(Exception e)
Print an error message for the given error. |
abstract void |
run()
Runs the application. |
static void |
runCLIApplication(Class<?> cls,
String[] args)
Generic command line invocation. |
static String |
usage(Collection<Pair<Object,Parameter<?,?>>> options)
Returns a usage message, explaining all known options |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Logging STATIC_LOGGER
private static final String NEWLINE
public static final String INFORMATION
public static final OptionID OUTPUT_ID
Key: -app.out
public static final OptionID INPUT_ID
Key: -app.in
private boolean verbose
Constructor Detail |
---|
public AbstractApplication(boolean verbose)
verbose
- Verbose flag.Method Detail |
---|
public final boolean isVerbose()
public static void runCLIApplication(Class<?> cls, String[] args)
cls
- Application class to run.args
- the arguments to run this application withpublic static String usage(Collection<Pair<Object,Parameter<?,?>>> options)
options
- Options to show in usage.
protected static void printErrorMessage(Exception e)
e
- Error Exception.private static void printDescription(Class<?> descriptionClass)
public abstract void run() throws UnableToComplyException
UnableToComplyException
- if
an error occurs during running the application
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |