wt.epm.retriever.graph
Class GraphNode
java.lang.Object
wt.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.
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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
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