Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.algorithm.result.AbstractResult<O>
Type Parameters:
O - the type of DatabaseObjects handled by this Result
All Implemented Interfaces:
Result<O>, Loggable
Direct Known Subclasses:
AprioriResult, Biclustering, CASHResult, CLIQUEModel, ClusterOrder, Clusters, ClustersPlusNoise, CorrelationAnalysisSolution, EMModel, HierarchicalClusters, KNNDistanceOrderResult, PartitionResults, PointerRepresentation, SubspaceClusterModel

public abstract class AbstractResult<O extends DatabaseObject>
extends AbstractLoggable
implements Result<O>

Abstract super class for a result object. Encapsulates methods common for many result objects.

Author:
Elke Achtert

Field Summary
protected  Database<O> db
          The database containing the objects of this result.
static String FILE_EXTENSION
          Extension for txt-files.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Fields inherited from interface de.lmu.ifi.dbs.elki.algorithm.result.Result
SEPARATOR
 
Constructor Summary
protected AbstractResult(Database<O> db)
          Creates a new abstract result object.
 
Method Summary
 Database<O> getDatabase()
          Returns the database to which this clustering result belongs to.
 void output(File out, Normalization<O> normalization, List<AttributeSettings> settings)
          Writes the clustering result to the given file.
protected  void writeHeader(PrintStream out, List<AttributeSettings> settings, List<String> headerInformation)
          Writes a header providing information concerning the underlying database and the specified parameter-settings.
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, 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.algorithm.result.Result
output
 

Field Detail

FILE_EXTENSION

public static final String FILE_EXTENSION
Extension for txt-files.

See Also:
Constant Field Values

db

protected Database<O extends DatabaseObject> db
The database containing the objects of this result.

Constructor Detail

AbstractResult

protected AbstractResult(Database<O> db)
Creates a new abstract result object.

Parameters:
db - the database containing the objects of this result
Method Detail

writeHeader

protected void writeHeader(PrintStream out,
                           List<AttributeSettings> settings,
                           List<String> headerInformation)
Writes a header providing information concerning the underlying database and the specified parameter-settings.

Parameters:
out - the print stream where to write
settings - the settings to be written into the header
headerInformation - additional information to be printed in the header, each entry will be printed in one separate line

output

public void output(File out,
                   Normalization<O> normalization,
                   List<AttributeSettings> settings)
            throws UnableToComplyException
Description copied from interface: Result
Writes the clustering result to the given file. Clustering result implementations, which are likely to provide several clusters are supposed to use the filename as prefix for every file to create and to append a proper suffix. In case of occuring IOExceptions the output is expected to be given at the standard-out. Therefore this behaviour should be also achievable by giving a null-Object as parameter.

Specified by:
output in interface Result<O extends DatabaseObject>
Parameters:
out - file, which designates the location to write the results, or which's name designates the prefix of any locations to write the results, or which could remain null to designate the standard-out as location for output.
normalization - Normalization to restore original values according to, if this action is supported - may remain null.
settings - the settings to be written into the header, if this parameter is null, no header will be written
Throws:
UnableToComplyException - if any feature vector is not compatible with values initialized during normalization
See Also:
Result.output(File,Normalization,List)

getDatabase

public Database<O> getDatabase()
Returns the database to which this clustering result belongs to.

Returns:
the database to which this clustering result belongs to

Release 0.1 (2008-07-10_1838)