org.apache.uima.internal.util
Class GraphNode

java.lang.Object
  extended by 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
protected  java.lang.Object element
           
protected  java.util.ArrayList<GraphNode> predecessors
           
protected  java.util.ArrayList<GraphNode> successors
           
 
Constructor Summary
GraphNode(java.lang.Object element)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

element

protected java.lang.Object element

successors

protected java.util.ArrayList<GraphNode> successors

predecessors

protected java.util.ArrayList<GraphNode> predecessors
Constructor Detail

GraphNode

public GraphNode(java.lang.Object element)
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:
dtr - 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.


Copyright © 2011. All Rights Reserved.