edu.iastate.metnet.aracyc
Class GenericTree

java.lang.Object
  extended by org._3pq.jgrapht.graph.AbstractGraph
      extended by org._3pq.jgrapht.graph.AbstractBaseGraph
          extended by org._3pq.jgrapht.graph.DefaultDirectedGraph
              extended by edu.iastate.metnet.aracyc.GenericTree
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org._3pq.jgrapht.DirectedGraph, org._3pq.jgrapht.Graph
Direct Known Subclasses:
ClassTree

public class GenericTree
extends org._3pq.jgrapht.graph.DefaultDirectedGraph

tree structure

Since:
6/11/04
Author:
Jie Li
See Also:
Serialized Form

Constructor Summary
GenericTree()
           
 
Method Summary
 int childCount(java.lang.Object vertex)
          the child count
 java.util.Set getAscendant(java.lang.Object vertex)
          get the ascendant of te current node
 java.util.Set getChildren(java.lang.Object vertex)
          get the child node
 java.util.Set getDescendant(java.lang.Object vertex)
          get all descendant of the current vertex
 java.util.Set getLeaves()
          get the outdegree = 0's node in this graph
 java.util.Set getLeaves(java.lang.Object vertex)
          get the leaves in the subtree rooted by current node
 java.util.Set getOrphans()
           
 java.util.Set getParent(java.lang.Object vertex)
           
 java.util.Set getRoots()
          get the root of the tree, in which the root has only outdegree > 0 but indegree = 0
 java.util.Set getRoots(java.lang.Object vertex)
          return the root in the ascendant of the current node
 
Methods inherited from class org._3pq.jgrapht.graph.AbstractBaseGraph
addEdge, addEdge, addVertex, clone, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, incomingEdgesOf, inDegreeOf, isAllowingLoops, isAllowingMultipleEdges, outDegreeOf, outgoingEdgesOf, removeEdge, removeEdge, removeVertex, setEdgeListFactory, vertexSet
 
Methods inherited from class org._3pq.jgrapht.graph.AbstractGraph
addAllEdges, addAllVertices, assertVertexExist, containsEdge, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSets
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org._3pq.jgrapht.DirectedGraph
incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf
 
Methods inherited from interface org._3pq.jgrapht.Graph
addAllEdges, addAllVertices, addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet
 

Constructor Detail

GenericTree

public GenericTree()
Method Detail

getRoots

public java.util.Set getRoots()
get the root of the tree, in which the root has only outdegree > 0 but indegree = 0

Returns:
the root vertex

getRoots

public java.util.Set getRoots(java.lang.Object vertex)
return the root in the ascendant of the current node

Parameters:
vertex - the current node
Returns:
the set of the root in the subtree

getChildren

public java.util.Set getChildren(java.lang.Object vertex)
get the child node

Parameters:
vertex - current node
Returns:
the children

childCount

public int childCount(java.lang.Object vertex)
the child count

Parameters:
vertex - curent node
Returns:
the number of children node

getParent

public java.util.Set getParent(java.lang.Object vertex)

getLeaves

public java.util.Set getLeaves()
get the outdegree = 0's node in this graph

Returns:

getLeaves

public java.util.Set getLeaves(java.lang.Object vertex)
get the leaves in the subtree rooted by current node

Parameters:
vertex -
Returns:

getOrphans

public java.util.Set getOrphans()

getDescendant

public java.util.Set getDescendant(java.lang.Object vertex)
get all descendant of the current vertex

Returns:
the set of the descrendant

getAscendant

public java.util.Set getAscendant(java.lang.Object vertex)
get the ascendant of te current node

Parameters:
vertex - the current node
Returns:
ascendent node which has a directed path to the current node