Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.result
Class ResultWriter<O extends DatabaseObject>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.result.ResultWriter<O>
Type Parameters:
O - Object type
All Implemented Interfaces:
ResultHandler<O,Result>, Parameterizable

public class ResultWriter<O extends DatabaseObject>
extends AbstractParameterizable
implements ResultHandler<O,Result>

Result handler that feeds the data into a TextWriter

Author:
Erich Schubert

Field Summary
private  boolean gzip
          Whether or not to do gzip compression on output.
private  Flag GZIP_FLAG
          Flag to control GZIP compression.
private  OptionID GZIP_OUTPUT
          GZIP compression flag
private  Normalization<O> normalization
          Normalization to use.
private  File out
          Holds the file to print results to.
private  FileParameter OUTPUT_PARAM
          Optional Parameter to specify the file to write the obtained results in.
private  Flag OVERWRITE_FLAG
          Flag to suppress overwrite warning.
private  OptionID OVERWRITE_OPTION
          Suppress overwrite warning
private  boolean warnoverwrite
          Whether or not to warn on overwrite
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
ResultWriter()
          Constructor.
 
Method Summary
 Normalization<O> getNormalization()
          Getter for normalization
 void processResult(Database<O> db, Result result)
          Process a single result.
 void setNormalization(Normalization<O> normalization)
          Setter for normalization
 List<String> setParameters(List<String> args)
          set Parameters
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription
 

Field Detail

OUTPUT_PARAM

private final FileParameter OUTPUT_PARAM
Optional Parameter to specify the file to write the obtained results in. If this parameter is omitted, per default the output will sequentially be given to STDOUT.

Key: -out


GZIP_OUTPUT

private final OptionID GZIP_OUTPUT
GZIP compression flag


GZIP_FLAG

private final Flag GZIP_FLAG
Flag to control GZIP compression.


OVERWRITE_OPTION

private final OptionID OVERWRITE_OPTION
Suppress overwrite warning


OVERWRITE_FLAG

private final Flag OVERWRITE_FLAG
Flag to suppress overwrite warning.


out

private File out
Holds the file to print results to.


normalization

private Normalization<O extends DatabaseObject> normalization
Normalization to use.


gzip

private boolean gzip
Whether or not to do gzip compression on output.


warnoverwrite

private boolean warnoverwrite
Whether or not to warn on overwrite

Constructor Detail

ResultWriter

public ResultWriter()
Constructor.

Method Detail

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
set Parameters

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractParameterizable
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

processResult

public void processResult(Database<O> db,
                          Result result)
Process a single result.

Specified by:
processResult in interface ResultHandler<O extends DatabaseObject,Result>
Parameters:
db - Database
result - Result

setNormalization

public void setNormalization(Normalization<O> normalization)
Description copied from interface: ResultHandler
Setter for normalization

Specified by:
setNormalization in interface ResultHandler<O extends DatabaseObject,Result>
Parameters:
normalization - Normalization to use
See Also:
ResultHandler.setNormalization(de.lmu.ifi.dbs.elki.normalization.Normalization)

getNormalization

public Normalization<O> getNormalization()
Getter for normalization

Returns:
normalization object

Release 0.2 (2009-07-06_1820)