de.rwth.graph
Class Graph.Node.Edge

java.lang.Object
  |
  +--de.rwth.graph.Graph.Node.Edge
Enclosing class:
Graph.Node

public class Graph.Node.Edge
extends java.lang.Object

Represents edges starting or ending in this node.


Field Summary
protected  Graph.Node endNode
          The end node of this edge.
protected  java.lang.Object label
          The label of this edge.
protected  Graph.Node startNode
          The start node of this edge.
 
Constructor Summary
Graph.Node.Edge(Graph.Node endNode)
          Creates a new edge without label staring at this node.
Graph.Node.Edge(Graph.Node endNode, java.lang.Object label)
          Creates a new edge with label starting at this node.
 
Method Summary
 Graph.Node getEnd()
          Gets the ending Node of this edge.
 java.lang.Object getLabel()
          Gets the label of this edge.
 Graph.Node getStart()
          Gets the starting Node of this edge.
 void remove()
          Removes this Edge from the graph.
 void setEnd(Graph.Node node)
          Sets the ending Node of this edge.
 void setLabel(java.lang.Object label)
          Sets the label of this edge.
 void setStart(Graph.Node node)
          Sets the starting Node of this edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startNode

protected Graph.Node startNode
The start node of this edge.

endNode

protected Graph.Node endNode
The end node of this edge.

label

protected java.lang.Object label
The label of this edge.
Constructor Detail

Graph.Node.Edge

public Graph.Node.Edge(Graph.Node endNode)
Creates a new edge without label staring at this node.
Parameters:
endNode - The end node of the edge. It must be in the same graph.
Throws:
java.lang.IllegalArgumentException - if endNode is not a node in the same graph.

Graph.Node.Edge

public Graph.Node.Edge(Graph.Node endNode,
                       java.lang.Object label)
Creates a new edge with label starting at this node.
Parameters:
endNode - The end node of the edge.
label - The label of the edge.
Throws:
java.lang.IllegalArgumentException - if endNode is not a node in the same graph.
Method Detail

setLabel

public void setLabel(java.lang.Object label)
Sets the label of this edge.

getLabel

public java.lang.Object getLabel()
Gets the label of this edge.
Returns:
The Object which is the label of this edge.

getStart

public Graph.Node getStart()
Gets the starting Node of this edge.
Returns:
The Node where the edge starts.

setStart

public void setStart(Graph.Node node)
Sets the starting Node of this edge.
Parameters:
node - the new starting Node.
Throws:
java.lang.IllegalArgumentException - if node is not a node in the same graph.

getEnd

public Graph.Node getEnd()
Gets the ending Node of this edge.
Returns:
The Node where the edge ends.

setEnd

public void setEnd(Graph.Node node)
Sets the ending Node of this edge.
Parameters:
node - the new ending Node.
Throws:
java.lang.IllegalArgumentException - if node is not a node in the same graph.

remove

public void remove()
Removes this Edge from the graph.