de.lmu.ifi.dbs.elki.utilities.datastructures.hierarchy
Interface Hierarchy<O>

Type Parameters:
O - Object type
All Known Subinterfaces:
ModifiableHierarchy<O>
All Known Implementing Classes:
HierarchyHashmapList, HierarchyReferenceLists, ResultHierarchy

public interface Hierarchy<O>

This interface represents an (external) hierarchy of objects. It can contain arbitrary objects, BUT the hierarchy has to be accessed using the hierarchy object, i.e. hierarchy.getChildren(object);. See Hierarchical for an interface for objects with an internal hierarchy (where you can use object.getChildren();)


Method Summary
 List<O> getChildren(O self)
          Get children list.
 List<O> getParents(O self)
          Get parents list.
 IterableIterator<O> iterAncestors(O self)
          Iterate ancestors (recursive parents)
 IterableIterator<O> iterDescendants(O self)
          Iterate descendants (recursive children)
 int numChildren(O self)
          Get number of children
 int numParents(O self)
          Get number of (direct) parents
 

Method Detail

numChildren

int numChildren(O self)
Get number of children

Parameters:
self - object to get number of children for
Returns:
number of children

getChildren

List<O> getChildren(O self)
Get children list. Resulting list MAY be modified. Result MAY be null, if the model is not hierarchical.

Parameters:
self - object to get children for
Returns:
list of children

iterDescendants

IterableIterator<O> iterDescendants(O self)
Iterate descendants (recursive children)

Parameters:
self - object to get descendants for
Returns:
iterator for descendants

numParents

int numParents(O self)
Get number of (direct) parents

Parameters:
self - reference object
Returns:
number of parents

getParents

List<O> getParents(O self)
Get parents list. Resulting list MAY be modified. Result MAY be null, if the model is not hierarchical.

Parameters:
self - object to get parents for
Returns:
list of parents

iterAncestors

IterableIterator<O> iterAncestors(O self)
Iterate ancestors (recursive parents)

Parameters:
self - object to get ancestors for
Returns:
iterator for ancestors

Release 0.4.0 (2011-09-20_1324)