shared
Class Edge

java.lang.Object
  |
  +--shared.GraphObject
        |
        +--shared.Edge

public class Edge
extends GraphObject

The Edge class stores information for the edges in the Graph class. This is part of the LEDA package Graph design. The comments in Graph also apply to the edge class.


Field Summary
 boolean hidden
          TRUE if this Edge object is hidden, otherwise FALSE.
 Edge[] pred_adj_edge
          Preceeding adjacent Edges.
 Edge rev
          The Edge that is reverse in direction to this Edge object.
 Edge[] succ_adj_edge
          Succesive adjacent Edges.
 Node[] term
          Terminal Nodes for this Edge.
 
Fields inherited from class shared.GraphObject
data, id, obj_list_pred, obj_list_succ
 
Constructor Summary
Edge(Node terminal1, Node terminal2, java.lang.Object info)
          Constructor.
 
Method Summary
 Edge adj_pred()
          Returns the first preceeding adjacent Edge.
 Edge adj_succ()
          Returns the first successive adjacent Edge.
 void copy(Edge original)
          Copies the specified Edge object into this Edge object.
 Edge cyclic_adj_pred()
          Returns the first preceeding Edge instance from the source Node for this Edge instance.
 Edge cyclic_adj_succ()
          Returns the first successive Edge instance from the source Node for this Edge instance.
 Edge cyclic_in_pred()
          Returns the last Edge object before reaching a destination Node.
 Edge cyclic_in_succ()
          Returns the first Edge object connected to the source Node.
 Graph graph_of()
          Returns the Graph object which this Edge is a part of.
 Edge in_pred(Edge e)
          Returns the adjacent preceeding Edge of the specified Edge object.
 Edge in_succ(Edge e)
          Returns the succeding adjacent Edge of the specified Edge object.
 Node opposite(Node vertex, Edge edge)
          Returns the Node at the opposite end of the specified Edge connected to that Node.
 Edge Pred_Adj_Edge(int index)
          Returns the specified preceeding adjacent Edge.
 Edge Pred_Adj_Edge(Node vertex)
          Returns the preceeding adjacent Edge connected to the specified Node.
 void print_edge_entry(java.io.Writer out)
          Displays the object currently stored in this Edge object.
 void print_edge(java.io.Writer out)
          Displays this Edge object to the given Writer.
 Node source()
          Returns the source Node for this Edge.
 Edge Succ_Adj_Edge(int index)
          Returns the specified successive adjacent Edge.
 Edge Succ_Adj_Edge(Node vertex)
          Returns the successive adjacent Edge connected to the specified Node.
 Node target()
          Returns the target Node for this Edge.
 
Methods inherited from class shared.GraphObject
index, set_id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

succ_adj_edge

public Edge[] succ_adj_edge
Succesive adjacent Edges. These are edges that are added after this edge but are originating from the same origin node.

pred_adj_edge

public Edge[] pred_adj_edge
Preceeding adjacent Edges. These are edges that are present before this edge is created and have the same origin node.

term

public Node[] term
Terminal Nodes for this Edge. For directed Edges, term[0] is the source Node and term[1] is the target Node.

rev

public Edge rev
The Edge that is reverse in direction to this Edge object.

hidden

public boolean hidden
TRUE if this Edge object is hidden, otherwise FALSE.
Constructor Detail

Edge

public Edge(Node terminal1,
            Node terminal2,
            java.lang.Object info)
Constructor.
Parameters:
terminal1 - The origin terminal node.
terminal2 - The destination terminal node.
info - The Object containing data to be stored in thid Edge instance.
Method Detail

source

public Node source()
Returns the source Node for this Edge.
Returns:
The source Node for this Edge.

target

public Node target()
Returns the target Node for this Edge.
Returns:
The destination Node for this Edge.

opposite

public Node opposite(Node vertex,
                     Edge edge)
Returns the Node at the opposite end of the specified Edge connected to that Node.
Parameters:
vertex - The Node instance at the given end of the Edge.
edge - The Edge instance for which the opposite edn is requested.
Returns:
The Node at the opposite end of the specified Edge instance.

graph_of

public Graph graph_of()
Returns the Graph object which this Edge is a part of.
Returns:
The Graph instance this Edge is a part of.

copy

public void copy(Edge original)
Copies the specified Edge object into this Edge object.
Parameters:
original - The Edge instance to be copied.

Succ_Adj_Edge

public Edge Succ_Adj_Edge(int index)
Returns the specified successive adjacent Edge.
Parameters:
index - The number of the specified Edge. Must be 0 or 1.
Returns:
The specified successive adjacent Edge.

Pred_Adj_Edge

public Edge Pred_Adj_Edge(int index)
Returns the specified preceeding adjacent Edge.
Parameters:
index - The number of the specified Edge. Must be 0 or 1.
Returns:
The specified preceeding adjacent Edge.

Succ_Adj_Edge

public Edge Succ_Adj_Edge(Node vertex)
Returns the successive adjacent Edge connected to the specified Node. Searches through all succesive Edges until the appropriate one is found. Assumes the connecting Edge exists.
Parameters:
vertex - The specified Node for which a connecting Edge is requested.
Returns:
The Edge connecting to the specified Node.

Pred_Adj_Edge

public Edge Pred_Adj_Edge(Node vertex)
Returns the preceeding adjacent Edge connected to the specified Node. Searches through all preceeding Edges until the appropriate one is found. Assumes the connecting Edge exists.
Parameters:
vertex - The specified Node for which a connecting Edge is requested.
Returns:
The Edge connecting to the specified Node.

adj_succ

public Edge adj_succ()
Returns the first successive adjacent Edge.
Returns:
The immediately succesive Edge.

adj_pred

public Edge adj_pred()
Returns the first preceeding adjacent Edge.
Returns:
The immediately preceeding Edge.

cyclic_adj_succ

public Edge cyclic_adj_succ()
Returns the first successive Edge instance from the source Node for this Edge instance.
Returns:
The Edge instance from the source Node for this Edge instance.

cyclic_adj_pred

public Edge cyclic_adj_pred()
Returns the first preceeding Edge instance from the source Node for this Edge instance.
Returns:
The Edge instance from the source Node for this Edge instance.

cyclic_in_succ

public Edge cyclic_in_succ()
Returns the first Edge object connected to the source Node.
Returns:
The Edge object immediately connecting the source Node to the Edges connecting to the next Node.

cyclic_in_pred

public Edge cyclic_in_pred()
Returns the last Edge object before reaching a destination Node.
Returns:
The last Edge object before the edge terminates at a Node.

in_succ

public Edge in_succ(Edge e)
Returns the succeding adjacent Edge of the specified Edge object.
Parameters:
e - The Edge for which the adjacent Edge is requested.
Returns:
The adjacent Edge of the specified Edge.

in_pred

public Edge in_pred(Edge e)
Returns the adjacent preceeding Edge of the specified Edge object.
Parameters:
e - The Edge for which the adjacent Edge is requested.
Returns:
The adjacent Edge of the specified Edge.

print_edge_entry

public void print_edge_entry(java.io.Writer out)
                      throws java.io.IOException
Displays the object currently stored in this Edge object.
Parameters:
out - The Writer to which the Edge information will be displayed.
Throws:
java.io.IOException - if the Writer experiences an IOException during use.

print_edge

public void print_edge(java.io.Writer out)
                throws java.io.IOException
Displays this Edge object to the given Writer.
Parameters:
out - The Writer to which the Edge information will be displayed.
Throws:
java.io.IOException - if the Writer experiences an IOException during use.