de.unihalle.informatik.MiToBo.core.datatypes
Class MTBGraphNode<T>

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBGraphNode<T>
Type Parameters:
T - Type parameter of MTBGraphNode. Possible choices are Point, Point2D, Integer, etc.
Direct Known Subclasses:
MTBNeuriteSkelGraphNode

public class MTBGraphNode<T>
extends java.lang.Object

Class implements MTBGraphNodes for the MTBGraph. Each MTBGraphNode has data and incoming and outgoing edges. If the edge is undirected, there is no difference between incoming and outgoing edges.

Author:
misiak
See Also:
MTBGraphEdge

Field Summary
protected  T data
          MTBGraphNode data.
protected  java.util.Vector<MTBGraphEdge> inEdges
          Vector of incoming edges of the MTBGraphNode.
protected  java.util.Vector<MTBGraphEdge> outEdges
          Vector of outgoing edges of the MTBGraphNode.
 
Constructor Summary
MTBGraphNode(T data)
          Constructor to create a new MTBGraphNode object.
 
Method Summary
protected  void addInEdge(MTBGraphEdge inEdge)
          Add a incoming MTBGraphEdge to the MTBGraphNode
protected  void addOutEdge(MTBGraphEdge outEdge)
          Add a outgoing MTBGraphEdge to the MTBGraphNode
 java.util.Vector<MTBGraphEdge> getAllEdges()
          Get all edges of the node.
 T getData()
          Get data of MTBGraphNode.
 java.util.Vector<MTBGraphEdge> getInEdges()
          Get input edges for node.
 java.util.Vector<MTBGraphNode<T>> getNeighbors()
          Get all neighbors of the current node.
 int getNumberOfInEdges()
          Get number of incoming edges for MTBGraphNode.
 int getNumberOfOutEdges()
          Get number of outgoing edges for MTBGraphNode.
 java.util.Vector<MTBGraphEdge> getOutEdges()
          Get outgoing edges for node.
 int getTotalNumberOfEdges()
          Get total number of edges for MTBGraphNode.
protected  void removeInEdge(MTBGraphEdge inEdge)
          Remove a incoming MTBGraphEdge from the MTBGraphNode.
protected  void removeOutEdge(MTBGraphEdge outEdge)
          Remove a outgoing MTBGraphEdge from the MTBGraphNode.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected T data
MTBGraphNode data. Type of the data is generic.


inEdges

protected java.util.Vector<MTBGraphEdge> inEdges
Vector of incoming edges of the MTBGraphNode.


outEdges

protected java.util.Vector<MTBGraphEdge> outEdges
Vector of outgoing edges of the MTBGraphNode.

Constructor Detail

MTBGraphNode

public MTBGraphNode(T data)
Constructor to create a new MTBGraphNode object.

Parameters:
data - data of the MTBGraphNode
Method Detail

addInEdge

protected void addInEdge(MTBGraphEdge inEdge)
Add a incoming MTBGraphEdge to the MTBGraphNode

Parameters:
inEdge - incoming MTBGraphEdge to add

addOutEdge

protected void addOutEdge(MTBGraphEdge outEdge)
Add a outgoing MTBGraphEdge to the MTBGraphNode

Parameters:
outEdge - outgoing MTBGraphEdge to add

getAllEdges

public java.util.Vector<MTBGraphEdge> getAllEdges()
Get all edges of the node. No decision between input edges or output edges is made.

Returns:
Vector of all MTBGraphEdges of the MTBGraphNode.

getData

public T getData()
Get data of MTBGraphNode.

Returns:
Data of MTBGraphNode from generic type.

getInEdges

public java.util.Vector<MTBGraphEdge> getInEdges()
Get input edges for node.

Returns:
Vector if incoming MTBGraphEdges.

getNeighbors

public java.util.Vector<MTBGraphNode<T>> getNeighbors()
Get all neighbors of the current node. Neighbors are these nodes, which are connected with the current node via an input or output edge

Returns:
List of neighbors for the current node.

getNumberOfInEdges

public int getNumberOfInEdges()
Get number of incoming edges for MTBGraphNode.

Returns:
Number of incoming MTBGraphEdges.

getNumberOfOutEdges

public int getNumberOfOutEdges()
Get number of outgoing edges for MTBGraphNode.

Returns:
Number of outgoing MTBGraphEdges.

getOutEdges

public java.util.Vector<MTBGraphEdge> getOutEdges()
Get outgoing edges for node.

Returns:
Vector if outgoing MTBGraphEdges.

getTotalNumberOfEdges

public int getTotalNumberOfEdges()
Get total number of edges for MTBGraphNode.

Returns:
Number of incoming and outgoing MTBGraphEdges of the MTBGraphNode.

removeInEdge

protected void removeInEdge(MTBGraphEdge inEdge)
Remove a incoming MTBGraphEdge from the MTBGraphNode.

Parameters:
inEdge - input edge to remove

removeOutEdge

protected void removeOutEdge(MTBGraphEdge outEdge)
Remove a outgoing MTBGraphEdge from the MTBGraphNode.

Parameters:
outEdge - outgoing edge to remove

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object