Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.algorithm.result
Class KNNJoinResult<O extends DatabaseObject,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.algorithm.result.KNNJoinResult<O,D>
Type Parameters:
O - the type of DatabaseObjects handled by this Result
D - the type of Distance used by this Result
All Implemented Interfaces:
Result<O>

public class KNNJoinResult<O extends DatabaseObject,D extends Distance<D>>
extends Object
implements Result<O>

Provides the result of a kNN-Join.

Author:
Elke Achtert

Field Summary
private  HashMap<Integer,KNNList<D>> knnLists
          The kNN lists for each object.
 
Fields inherited from interface de.lmu.ifi.dbs.elki.algorithm.result.Result
SEPARATOR
 
Constructor Summary
KNNJoinResult(HashMap<Integer,KNNList<D>> knnLists)
          Creates a new KNNJoinResult.
 
Method Summary
 D getKNNDistance(Integer id)
          Returns the knn distance of the object with the specified id.
 KNNList<D> getKNNs(Integer id)
          Returns the knns of the object with the specified id.
 void output(File out, Normalization<O> normalization, List<AttributeSettings> settings)
          Writes the clustering result to the given file.
 void output(PrintStream outStream, Normalization<O> normalization, List<AttributeSettings> settings)
          Writes the clustering result to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

knnLists

private HashMap<Integer,KNNList<D extends Distance<D>>> knnLists
The kNN lists for each object.

Constructor Detail

KNNJoinResult

public KNNJoinResult(HashMap<Integer,KNNList<D>> knnLists)
Creates a new KNNJoinResult.

Parameters:
knnLists - the kNN lists for each object
Method Detail

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)

output

public void output(PrintStream outStream,
                   Normalization<O> normalization,
                   List<AttributeSettings> settings)
            throws UnableToComplyException
Description copied from interface: Result
Writes the clustering result to the given stream.

Specified by:
output in interface Result<O extends DatabaseObject>
Parameters:
outStream - the stream to write to
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

getKNNDistance

public D getKNNDistance(Integer id)
Returns the knn distance of the object with the specified id.

Parameters:
id - the id of the object
Returns:
the knn distance of the object with the specified id

getKNNs

public KNNList<D> getKNNs(Integer id)
Returns the knns of the object with the specified id.

Parameters:
id - the id of the object
Returns:
the knns of the object with the specified id

Release 0.1 (2008-07-10_1838)