Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.algorithm.clustering.correlation.cash
Class CASHInterval

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.HyperBoundingBox
          extended by de.lmu.ifi.dbs.elki.algorithm.clustering.correlation.cash.CASHInterval
All Implemented Interfaces:
Loggable, Identifiable<CASHInterval>, Externalizable, Serializable, Comparable<Identifiable<CASHInterval>>

public class CASHInterval
extends HyperBoundingBox
implements Identifiable<CASHInterval>

Provides a unique interval represented by its id, a hyper bounding box reppresenting the alpha intervals, an interval of the correspinding distance, and a set of objects ids associated with this interval.

Author:
Elke Achtert
See Also:
Serialized Form

Field Summary
private  double d_max
          The maximum distance value.
private  double d_min
          The minimum distance value.
private static int ID
          Used for id assignment.
private  Set<Integer> ids
          Holds the ids of the objects associated with this interval.
private  int intervalID
          Holds the unique id of this interval.
private  CASHInterval leftChild
          Holds the left child.
private  int level
          The level of this interval, 0 indicates the root level.
private  int maxSplitDimension
          Holds the maximum dimension which has already been splitted.
private  CASHInterval rightChild
          Holds the right child.
private  CASHIntervalSplit split
          The object to perform interval splitting.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
CASHInterval()
          Empty constructor for Externalizable interface.
CASHInterval(double[] min, double[] max, CASHIntervalSplit split, Set<Integer> ids, int maxSplitDimension, int level, double d_min, double d_max)
          Provides a unique interval represented by its id, a hyper bounding box and a set of objects ids associated with this interval.
 
Method Summary
 int compareTo(Identifiable<CASHInterval> o)
          Compares this object with the specified object for order.
 boolean equals(Object o)
           
 double getD_max()
          Returns the maximum distance value.
 double getD_min()
          Returns the minimum distance value.
 Integer getID()
          Returns the unique id of this interval.
 Set<Integer> getIDs()
          Returns the set of ids of the objects associated with this interval.
 CASHInterval getLeftChild()
          Returns the left child of this interval.
 int getLevel()
          Returns the level of this interval.
 int getMaxSplitDimension()
          Returns the maximum split dimension.
 CASHInterval getRightChild()
          Returns the right child of this interval.
 boolean hasChildren()
          Returns true if this interval has children.
 int hashCode()
           
 boolean isSplitted(int d)
          Returns true if this interval has already been splitted in the specified dimension.
 int numObjects()
          Returns the number of objects associated with this interval
 int priority()
          Returns the priority of this interval (used as key in the heap).
 void removeIDs(Set ids)
          Removes the specified ids from this interval.
 void split()
          Splits this interval into 2 children.
 String toString()
          Retuns a String representation of the HyperBoundingBox.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.HyperBoundingBox
centroid, centroid, contains, contains, getDimensionality, getMax, getMax, getMin, getMin, intersects, overlap, perimeter, readExternal, toString, union, volume, writeExternal
 
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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

private static int ID
Used for id assignment.


intervalID

private final int intervalID
Holds the unique id of this interval.


level

private int level
The level of this interval, 0 indicates the root level.


d_min

private double d_min
The minimum distance value.


d_max

private double d_max
The maximum distance value.


ids

private Set<Integer> ids
Holds the ids of the objects associated with this interval.


maxSplitDimension

private int maxSplitDimension
Holds the maximum dimension which has already been splitted.


leftChild

private CASHInterval leftChild
Holds the left child.


rightChild

private CASHInterval rightChild
Holds the right child.


split

private CASHIntervalSplit split
The object to perform interval splitting.

Constructor Detail

CASHInterval

public CASHInterval()
Empty constructor for Externalizable interface.


CASHInterval

public CASHInterval(double[] min,
                    double[] max,
                    CASHIntervalSplit split,
                    Set<Integer> ids,
                    int maxSplitDimension,
                    int level,
                    double d_min,
                    double d_max)
Provides a unique interval represented by its id, a hyper bounding box and a set of objects ids associated with this interval.

Parameters:
min - the coordinates of the minimum hyper point
max - the coordinates of the maximum hyper point
split - the object to perform interval splitting
ids - the ids of the objects associated with this interval
maxSplitDimension - the maximum dimension which has already been splitted
level - the level of this interval, 0 indicates the root level
d_min - the minimum distance value
d_max - the maximum distance value
Method Detail

getIDs

public Set<Integer> getIDs()
Returns the set of ids of the objects associated with this interval.

Returns:
the set of ids of the objects associated with this interval

removeIDs

public void removeIDs(Set ids)
Removes the specified ids from this interval.

Parameters:
ids - the set of ids to be removed

numObjects

public int numObjects()
Returns the number of objects associated with this interval

Returns:
the number of objects associated with this interval

isSplitted

public boolean isSplitted(int d)
Returns true if this interval has already been splitted in the specified dimension.

Parameters:
d - the dimension to be tested
Returns:
true if this interval has already been splitted in the specified dimension

toString

public String toString()
Retuns a String representation of the HyperBoundingBox.

Overrides:
toString in class HyperBoundingBox
Returns:
String

priority

public int priority()
Returns the priority of this interval (used as key in the heap).

Returns:
the priority of this interval (used as key in the heap)

getMaxSplitDimension

public int getMaxSplitDimension()
Returns the maximum split dimension.

Returns:
the maximum split dimension

getLevel

public int getLevel()
Returns the level of this interval.

Returns:
the level of this interval

getLeftChild

public CASHInterval getLeftChild()
Returns the left child of this interval.

Returns:
the left child of this interval

getRightChild

public CASHInterval getRightChild()
Returns the right child of this interval.

Returns:
the right child of this interval

getID

public Integer getID()
Returns the unique id of this interval.

Specified by:
getID in interface Identifiable<CASHInterval>
Returns:
the unique id of this interval

getD_min

public double getD_min()
Returns the minimum distance value.

Returns:
the minimum distance value

getD_max

public double getD_max()
Returns the maximum distance value.

Returns:
the maximum distance value

compareTo

public int compareTo(Identifiable<CASHInterval> o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface Comparable<Identifiable<CASHInterval>>

equals

public boolean equals(Object o)
Overrides:
equals in class HyperBoundingBox
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class HyperBoundingBox
See Also:
Object.hashCode()

hasChildren

public boolean hasChildren()
Returns true if this interval has children.

Returns:
if this interval has children

split

public void split()
Splits this interval into 2 children.


Release 0.1 (2008-07-10_1838)