org.semanticweb.HermiT.hierarchy
Class Hierarchy<E>

java.lang.Object
  extended by org.semanticweb.HermiT.hierarchy.Hierarchy<E>

public class Hierarchy<E>
extends java.lang.Object


Nested Class Summary
protected  class Hierarchy.HierarchyDepthFinder<T>
           
protected static class Hierarchy.HierarchyNodeComparator<E>
           
protected static interface Hierarchy.HierarchyNodeVisitor<E>
           
static interface Hierarchy.Transformer<E,T>
           
 
Field Summary
protected  HierarchyNode<E> m_bottomNode
           
protected  java.util.Map<E,HierarchyNode<E>> m_nodesByElements
           
protected  HierarchyNode<E> m_topNode
           
 
Constructor Summary
Hierarchy(HierarchyNode<E> topNode, HierarchyNode<E> bottomNode)
           
 
Method Summary
static
<T> Hierarchy<T>
emptyHierarchy(java.util.Collection<T> elements, T topElement, T bottomElement)
           
 java.util.Set<E> getAllElements()
           
 java.util.Collection<HierarchyNode<E>> getAllNodes()
           
 java.util.Set<HierarchyNode<E>> getAllNodesSet()
           
 HierarchyNode<E> getBottomNode()
           
 int getDepth()
           
 HierarchyNode<E> getNodeForElement(E element)
           
 HierarchyNode<E> getTopNode()
           
 boolean isEmpty()
           
<T> Hierarchy<T>
transform(Hierarchy.Transformer<? super E,T> transformer, java.util.Comparator<T> comparator)
           
 void traverseDepthFirst(Hierarchy.HierarchyNodeVisitor<E> visitor)
           
protected  void traverseDepthFirst(Hierarchy.HierarchyNodeVisitor<E> visitor, int level, HierarchyNode<E> node, HierarchyNode<E> parentNode, java.util.Set<HierarchyNode<E>> visited, HierarchyNode<E>[] redirectBuffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_topNode

protected final HierarchyNode<E> m_topNode

m_bottomNode

protected final HierarchyNode<E> m_bottomNode

m_nodesByElements

protected final java.util.Map<E,HierarchyNode<E>> m_nodesByElements
Constructor Detail

Hierarchy

public Hierarchy(HierarchyNode<E> topNode,
                 HierarchyNode<E> bottomNode)
Method Detail

getTopNode

public HierarchyNode<E> getTopNode()

getBottomNode

public HierarchyNode<E> getBottomNode()

isEmpty

public boolean isEmpty()

getNodeForElement

public HierarchyNode<E> getNodeForElement(E element)

getAllNodes

public java.util.Collection<HierarchyNode<E>> getAllNodes()

getAllNodesSet

public java.util.Set<HierarchyNode<E>> getAllNodesSet()

getAllElements

public java.util.Set<E> getAllElements()

getDepth

public int getDepth()

transform

public <T> Hierarchy<T> transform(Hierarchy.Transformer<? super E,T> transformer,
                                  java.util.Comparator<T> comparator)

traverseDepthFirst

public void traverseDepthFirst(Hierarchy.HierarchyNodeVisitor<E> visitor)

traverseDepthFirst

protected void traverseDepthFirst(Hierarchy.HierarchyNodeVisitor<E> visitor,
                                  int level,
                                  HierarchyNode<E> node,
                                  HierarchyNode<E> parentNode,
                                  java.util.Set<HierarchyNode<E>> visited,
                                  HierarchyNode<E>[] redirectBuffer)

emptyHierarchy

public static <T> Hierarchy<T> emptyHierarchy(java.util.Collection<T> elements,
                                              T topElement,
                                              T bottomElement)