Class Edge

java.lang.Object
  |
  +--Edge

public class Edge
extends java.lang.Object

A representation of an edge. Created: Fri Mar 31 09:31:36 2000


Constructor Summary
Edge(Node from, Node to)
          Creates an edge from the from-node to the to-node.
 
Method Summary
 void remove()
          Removes this edge.
 java.lang.String toString()
          Produce a stringrepresentation of a edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Edge

public Edge(Node from,
            Node to)
Creates an edge from the from-node to the to-node. Even though the two nodes are adjacent an edge will be made between them. O(1).
Parameters:
from - The origin of the newly created edge.
to - The destination of the newly created edge.
Method Detail

remove

public void remove()
Removes this edge. The data structures in the nodes are updated accordingly. O(1).

toString

public java.lang.String toString()
Produce a stringrepresentation of a edge. This is just a pair of node representations. O(1).
Overrides:
toString in class java.lang.Object