|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.logging.AbstractLoggable de.lmu.ifi.dbs.elki.algorithm.result.clustering.HierarchicalCluster<C>
C
- the type of HierarchicalCluster used by this Resultpublic class HierarchicalCluster<C extends HierarchicalCluster<C>>
Abstract super class for a hierarchical cluster that holds the ids of the objects belonging to this cluster and the children and parents of this cluster. Hierarchical clusters allow multiple inheritance and can be visualized in a graph.
Field Summary | |
---|---|
private List<C> |
children
The children of this cluster. |
private Set<Integer> |
ids
Holds the ids belonging to this cluster. |
private String |
label
The label of this cluster, needed for graph visualization. |
private int |
level
The level of this cluster within the graph visualization. |
private int |
levelIndex
The index of this cluster within the level, needed for graph visualization. |
private List<C> |
parents
The parents of this cluster. |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
Constructor Summary | |
---|---|
HierarchicalCluster()
Provides a new empty hierarchical cluster with the specified preference vector. |
|
HierarchicalCluster(Set<Integer> ids,
List<C> children,
List<C> parents,
String label,
int level,
int levelIndex)
Provides a new hierarchical cluster the that holds the ids of the objects belonging to this cluster and the children and parents of this cluster. |
Method Summary | |
---|---|
void |
addChild(C child)
Adds a child cluster to this cluster. |
void |
addID(Integer id)
Adds a new id to this cluster. |
void |
addIDs(List<Integer> ids)
Adds the specified list of ids to this cluster. |
void |
addParent(C parent)
Adds a parent to this cluster. |
int |
compareTo(C o)
Compares this object with the specified object for order. |
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one. |
C |
getChild(int i)
Returns the child at the specified index. |
List<C> |
getChildren()
Returns the children of this cluster. |
List<Integer> |
getIDs()
Returns the ids belonging to this cluster. |
String |
getLabel()
Returns the label of this cluster. |
int |
getLevel()
Returns the level of this cluster. |
int |
getLevelIndex()
Returns the index within the level of this cluster. |
C |
getParent(int i)
Returns the parent at the specified index. |
List<C> |
getParents()
Returns the parents of this cluster. |
int |
numChildren()
Returns the number of children. |
int |
numParents()
Returns the number of parents. |
void |
removeID(Integer id)
Removes the specified id from the list of ids of this cluster. |
void |
setLabel(String label)
Sets the label of this cluster. |
void |
setLevel(int level)
Sets the level of this cluster. |
void |
setLevelIndex(int levelIndex)
Sets the index within the level of this cluster. |
String |
toString()
Returns the label of this HierarchicalCluster. |
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, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final Set<Integer> ids
private final List<C extends HierarchicalCluster<C>> children
private final List<C extends HierarchicalCluster<C>> parents
private int level
private int levelIndex
private String label
Constructor Detail |
---|
public HierarchicalCluster()
public HierarchicalCluster(Set<Integer> ids, List<C> children, List<C> parents, String label, int level, int levelIndex)
ids
- the ids of the objects belonging to this clusterchildren
- the list of children of this clusterparents
- the list of parents of this clusterlabel
- the label of this clusterlevel
- the level of this cluster in the graphlevelIndex
- the index of this cluster within the levelMethod Detail |
---|
public final void addID(Integer id)
id
- the id to be addedpublic final void addIDs(List<Integer> ids)
ids
- the ids to be addedpublic final void removeID(Integer id)
id
- the id to be removedpublic final void addChild(C child)
child
- the child to be added.public final List<C> getChildren()
public final void addParent(C parent)
parent
- the parent to be added.public final List<C> getParents()
public final int getLevel()
public final int getLevelIndex()
public final void setLevelIndex(int levelIndex)
levelIndex
- the index to be setpublic final void setLabel(String label)
label
- the label of this clusterpublic String getLabel()
public void setLevel(int level)
level
- the level to be setpublic final String toString()
toString
in class Object
public final List<Integer> getIDs()
public final int compareTo(C o)
compareTo
in interface Comparable<C extends HierarchicalCluster<C>>
o
- the Object to be compared.
public final boolean equals(Object o)
equals
in class Object
o
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.public final int numChildren()
numChildren
in interface Enumeratable<C extends HierarchicalCluster<C>>
public final int numParents()
public final C getChild(int i)
getChild
in interface Enumeratable<C extends HierarchicalCluster<C>>
i
- the index of the child to be returned
public final C getParent(int i)
i
- the index of the parent to be returned
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |