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.result.ResultWriter<O>
Type Parameters:
O - Object type
All Implemented Interfaces:
ResultHandler<O,Result>, Parameterizable

public class ResultWriter<O extends DatabaseObject>
extends AbstractLoggable
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.logging.AbstractLoggable
debug, logger
 
Constructor Summary
ResultWriter(Parameterization config)
          Constructor, adhering to Parameterizable
 
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
 
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
 

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.

Key: -out.gzip


OVERWRITE_OPTION

private final OptionID OVERWRITE_OPTION
Suppress overwrite warning.


OVERWRITE_FLAG

private final Flag OVERWRITE_FLAG
Flag to suppress overwrite warning.

Key: -out.silentoverwrite


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(Parameterization config)
Constructor, adhering to Parameterizable

Parameters:
config - Parameterization
Method Detail

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.3 (2010-03-31_1612)