de.lmu.ifi.dbs.elki.result.optics
Class ClusterOrderResult<D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
      extended by de.lmu.ifi.dbs.elki.result.BasicResult
          extended by de.lmu.ifi.dbs.elki.result.optics.ClusterOrderResult<D>
Type Parameters:
D - distance type.
All Implemented Interfaces:
HierarchicalResult, IterableResult<ClusterOrderEntry<D>>, Result, Iterable<ClusterOrderEntry<D>>

public class ClusterOrderResult<D extends Distance<D>>
extends BasicResult
implements IterableResult<ClusterOrderEntry<D>>

Class to store the result of an ordering clustering algorithm such as OPTICS.


Nested Class Summary
(package private)  class ClusterOrderResult.ClusterOrderAdapter
          Ordering part of the result.
(package private)  class ClusterOrderResult.PredecessorAdapter
          Result containing the predecessor ID.
(package private)  class ClusterOrderResult.ReachabilityDistanceAdapter
          Result containing the reachability distances.
 
Field Summary
private  ArrayList<ClusterOrderEntry<D>> clusterOrder
          Cluster order storage
(package private)  ModifiableDBIDs dbids
          The DBIDs we are defined for
private  HashMap<DBID,ClusterOrderEntry<D>> map
          Map of object IDs to their cluster order entry
 
Constructor Summary
ClusterOrderResult(String name, String shortname)
          Constructor
 
Method Summary
 void add(ClusterOrderEntry<D> ce)
          Add an object to the cluster order.
 void add(DBID id, DBID predecessor, D reachability)
          Add an object to the cluster order.
 List<ClusterOrderEntry<D>> getClusterOrder()
          Retrieve the complete cluster order.
 Class<?> getDistanceClass()
          Get the distance class
 Iterator<ClusterOrderEntry<D>> iterator()
          The cluster order is iterable
 
Methods inherited from class de.lmu.ifi.dbs.elki.result.BasicResult
getLongName, getShortName
 
Methods inherited from class de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
addChildResult, getHierarchy, setHierarchy
 
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.result.Result
getLongName, getShortName
 

Field Detail

clusterOrder

private ArrayList<ClusterOrderEntry<D extends Distance<D>>> clusterOrder
Cluster order storage


map

private HashMap<DBID,ClusterOrderEntry<D extends Distance<D>>> map
Map of object IDs to their cluster order entry


dbids

ModifiableDBIDs dbids
The DBIDs we are defined for

Constructor Detail

ClusterOrderResult

public ClusterOrderResult(String name,
                          String shortname)
Constructor

Parameters:
name - The long name (for pretty printing)
shortname - the short name (for filenames etc.)
Method Detail

getClusterOrder

public List<ClusterOrderEntry<D>> getClusterOrder()
Retrieve the complete cluster order.

Returns:
cluster order

iterator

public Iterator<ClusterOrderEntry<D>> iterator()
The cluster order is iterable

Specified by:
iterator in interface IterableResult<ClusterOrderEntry<D extends Distance<D>>>
Specified by:
iterator in interface Iterable<ClusterOrderEntry<D extends Distance<D>>>
Returns:
iterator

add

public void add(DBID id,
                DBID predecessor,
                D reachability)
Add an object to the cluster order.

Parameters:
id - Object ID
predecessor - Predecessor ID
reachability - Reachability distance

add

public void add(ClusterOrderEntry<D> ce)
Add an object to the cluster order.

Parameters:
ce - Entry

getDistanceClass

public Class<?> getDistanceClass()
Get the distance class

Returns:
distance class. Can be null for an all-undefined result!

Release 0.4.0 (2011-09-20_1324)