Package org.apache.uima.internal.util
Class GraphNode
- java.lang.Object
-
- org.apache.uima.internal.util.GraphNode
-
public class GraphNode extends java.lang.Object
Interface for a generic node in a graph.- See Also:
Graph
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
element
protected java.util.ArrayList<GraphNode>
predecessors
protected java.util.ArrayList<GraphNode>
successors
-
Constructor Summary
Constructors Constructor Description GraphNode(java.lang.Object element)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPredecessor(GraphNode pred)
Add a new predecessor node.void
addSuccessor(GraphNode succ)
Add a new successor node.void
connect(GraphNode node)
Connect this node to a new node.java.lang.Object
getElement()
Get the element contained in the node.int
getNbrPred()
Get the number of predecessor node.int
getNbrSucc()
Get the number of successor node.GraphNode
getPredecessor(int i)
Get a specific predecessor node.GraphNode
getSuccessor(int i)
Get a specific successor node.void
setElement(java.lang.Object element)
Set the element in the node.
-
-
-
Method Detail
-
getElement
public java.lang.Object getElement()
Get the element contained in the node.- Returns:
- The object contained in the node.
-
setElement
public void setElement(java.lang.Object element)
Set the element in the node.- Parameters:
element
- The element.
-
getNbrSucc
public int getNbrSucc()
Get the number of successor node.- Returns:
- The number of successor nodes.
-
getSuccessor
public GraphNode getSuccessor(int i)
Get a specific successor node. As usual, the count is 0-based.- Parameters:
i
- The number of the successor to be retrieved.- Returns:
- The successor node.
-
addSuccessor
public void addSuccessor(GraphNode succ)
Add a new successor node.- Parameters:
succ
- The node to be added.
-
getNbrPred
public int getNbrPred()
Get the number of predecessor node.- Returns:
- The number of predecessor nodes.
-
getPredecessor
public GraphNode getPredecessor(int i)
Get a specific predecessor node. As usual, the count is 0-based.- Parameters:
i
- The number of the predecessor to be retrieved.- Returns:
- The predecessor node.
-
addPredecessor
public void addPredecessor(GraphNode pred)
Add a new predecessor node.- Parameters:
pred
- The node to be added.
-
connect
public void connect(GraphNode node)
Connect this node to a new node.- Parameters:
node
- The node to be connected to.
-
-