com.rapidminer.operator.preprocessing.outlier
Class KdistanceContainer

java.lang.Object
  extended by com.rapidminer.operator.preprocessing.outlier.KdistanceContainer

public class KdistanceContainer
extends java.lang.Object

This class represents a container for objects within a given distance from another object.

It is a simple data structure with associated query and setting methods enabling a linked list of all distance-Containers for all objects in a search Room. As most objects in a SearchSpace are expected to be at different distances to each other, only a small number of objects is likely to be linked to a single distance Container. However, in very dense clusters the number can increase significantly.

Author:
Stephan Deutsch, Ingo Mierswa

Constructor Summary
KdistanceContainer(SearchObject so)
          This constructor creates a container for an associated SearchObject so (which has to be referenced) and sets the other aspects of the contained data to zero; it also creates a list of Objects.
 
Method Summary
 boolean addObject(SearchObject so, double dist)
          Adds a SearchObject to the container.
 double getDistance()
          Provides the distance of the container as an integer value.
 java.util.ListIterator getListIterator()
          This method delivers an Iterator on the list of objects of the container positioned at the beginning of the list.
 int getNumberOfObjects()
          Gives the number of objects in the container (e.g. which are actually in the list, but without the need to ask the list itself about its size).
 SearchObject getObject(int i)
          Returns an object from the list of objects in the container at position i (check needed if this returns the appropriate object, as internally, an iterator is started at position i in the list and the next() element is delivered back...).
 void setDistance(double dist)
          Sets the distance of the container to dist (double type value).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KdistanceContainer

public KdistanceContainer(SearchObject so)
This constructor creates a container for an associated SearchObject so (which has to be referenced) and sets the other aspects of the contained data to zero; it also creates a list of Objects.

Method Detail

getDistance

public double getDistance()
Provides the distance of the container as an integer value.


setDistance

public void setDistance(double dist)
Sets the distance of the container to dist (double type value).

Parameters:
dist -

getNumberOfObjects

public int getNumberOfObjects()
Gives the number of objects in the container (e.g. which are actually in the list, but without the need to ask the list itself about its size).


addObject

public boolean addObject(SearchObject so,
                         double dist)

Adds a SearchObject to the container.

Attention: As you do this, it has to be checked, if the distance between the associated SearchObject and the object added to the container is equal to the distance of the objects already in the container.

To achieve this, the method checks if the distance delivered as a sanity check parameter is equal to the distance of the container; if yes, the object is added, else not. A boolean state on the success is returned.

if the container is empty, e.g. the first object is added, no checks are necessary and hence the distance check against the initial zero value is not performed thus not preventing the addition of the object.

It is recommended to e.g. add an object so to the list of the objects of a container associated to an object soA with the following process:

KdistanceContainer.addObject(so, soA.getDistance(so));


getObject

public SearchObject getObject(int i)
Returns an object from the list of objects in the container at position i (check needed if this returns the appropriate object, as internally, an iterator is started at position i in the list and the next() element is delivered back...).

Parameters:
i -

getListIterator

public java.util.ListIterator getListIterator()
This method delivers an Iterator on the list of objects of the container positioned at the beginning of the list.



Copyright © 2001-2009 by Rapid-I