Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

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

public class ClusterOrderResult<D extends Distance<D>>
extends Object
implements OrderingResult, Iterable<ClusterOrderEntry<D>>

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

Author:
Erich Schubert

Field Summary
private  ArrayList<ClusterOrderEntry<D>> clusterOrder
          Cluster order storage
private  HashMap<Integer,ClusterOrderEntry<D>> map
          Map of object IDs to their cluster order entry
 
Constructor Summary
ClusterOrderResult()
          Constructor
 
Method Summary
 void add(ClusterOrderEntry<D> ce)
          Add an object ot the cluster order.
 void add(Integer id, Integer predecessor, D reachability)
          Add an object to the cluster order.
 Pair<String,Object>[] getAnnotations(Integer objID)
          Retrieve annotations for the cluster order.
 List<ClusterOrderEntry<D>> getClusterOrder()
          Retrieve the complete cluster order.
 Iterator<Integer> iter(Collection<Integer> ids)
          Use the cluster order to sort the given collection ids.
 Iterator<ClusterOrderEntry<D>> iterator()
          The cluster order is iterable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clusterOrder

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


map

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

Constructor Detail

ClusterOrderResult

public ClusterOrderResult()
Constructor

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 Iterable<ClusterOrderEntry<D extends Distance<D>>>

add

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

Parameters:
id -
predecessor -
reachability -

add

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

Parameters:
ce -

iter

public Iterator<Integer> iter(Collection<Integer> ids)
Use the cluster order to sort the given collection ids. Implementation of the OrderingResult interface.

Specified by:
iter in interface OrderingResult
Parameters:
ids - Collection of ids.
Returns:
iterator for sorted array of ids

getAnnotations

public Pair<String,Object>[] getAnnotations(Integer objID)
Retrieve annotations for the cluster order. Implementation of the AnnotationResult interface.

Parameters:
objID - Object ID
Returns:
Annotations for this object

Release 0.2.1 (2009-07-13_1605)