wt.epm.retriever.graph
Class GraphNode

java.lang.Object
  extended bywt.epm.retriever.graph.GraphNode
Direct Known Subclasses:
ResultGraph.Node

public class GraphNode
extends Object

Represents a node of the graph. Holds a reference to the incident edges/nodes. The constructor does not take lists of incident links as parameters just because the GraphEdge object constructor takes incident Nodes. But initParents() and initChildren() must be called upon GraphNode construction before any other method - otherwise any request for incident links will just produce NullPointerException.


Field Summary
protected  GraphEdge[] childLinks
           
protected  GraphNode[] children
           
private  Class edgeClass
           
protected  int id
           
protected  GraphEdge parentLink
           
protected  GraphEdge[] parentLinks
           
protected  GraphNode[] parents
           
 
Constructor Summary
protected GraphNode(Class edgeClass)
          The node object must be aware of the concrete class for links (edges) to properly allocate parent/children link arrays.
 
Method Summary
protected  GraphNode[] allocateGraphNodeArray(int length)
           
 GraphEdge[] getChildEdges()
           
 GraphNode[] getChildNodes()
           
 int getId()
          The number of this GraphNode in the getNodes() array.
 GraphEdge getParentEdge()
          Incoming link which belongs to the spanning tree.
 GraphEdge[] getParentEdges()
           
 GraphNode getParentNode()
           
 GraphNode[] getParentNodes()
           
 GraphEdge[] getTreeChildEdges()
           
 GraphNode[] getTreeChildNodes()
           
 void initChildren(List listChildren)
           
 void initParents(List listParents)
           
 boolean isRoot()
           
 boolean isSource()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentLinks

protected GraphEdge[] parentLinks

parentLink

protected GraphEdge parentLink

childLinks

protected GraphEdge[] childLinks

parents

protected GraphNode[] parents

children

protected GraphNode[] children

id

protected int id

edgeClass

private final Class edgeClass
Constructor Detail

GraphNode

protected GraphNode(Class edgeClass)
The node object must be aware of the concrete class for links (edges) to properly allocate parent/children link arrays.

Throws:
NullPointerException - if edgeClass is null
IllegalArgumentException - if edgeClass is not a sub-class of GraphEdge
Method Detail

initParents

public final void initParents(List listParents)

initChildren

public final void initChildren(List listChildren)

getParentEdges

public final GraphEdge[] getParentEdges()

getParentEdge

public final GraphEdge getParentEdge()
Incoming link which belongs to the spanning tree.

Returns:
GraphLink null for the tree root node(s)

getChildEdges

public final GraphEdge[] getChildEdges()

getTreeChildEdges

public final GraphEdge[] getTreeChildEdges()

allocateGraphNodeArray

protected GraphNode[] allocateGraphNodeArray(int length)

getParentNodes

public final GraphNode[] getParentNodes()

getParentNode

public final GraphNode getParentNode()

getChildNodes

public final GraphNode[] getChildNodes()

getTreeChildNodes

public final GraphNode[] getTreeChildNodes()

isSource

public final boolean isSource()

isRoot

public final boolean isRoot()

getId

public final int getId()
The number of this GraphNode in the getNodes() array.

Returns:
int