All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class att.grappa.Edge

java.lang.Object
   |
   +----att.grappa.Element
           |
           +----att.grappa.Edge

public class Edge
extends Element
This class describes an edge.

Version:
1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
Author:
John Mocenigo, Research @ AT&T Labs

Variable Index

 o defaultNamePrefix
Default edge name prefix used by setName().

Constructor Index

 o Edge(Subgraph, Node, Node)
Use this constructor when creating an edge.
 o Edge(Subgraph, Node, String, Node, String)
Use this constructor when creating an edge with ports.
 o Edge(Subgraph, Node, String, Node, String, String)
Use this constructor when creating an edge requiring a key to distinguish it.

Method Index

 o findEdgeByKey(Node, Node, String)
Returns the edge with the given tail node, head node and key.
 o findEdgesByEnds(Node, Node)
Returns an enumeration of edges that have one end fixed at node1 and the other end at node2.
 o free()
Included to help speed release of valuable memory.
 o getHead()
Get the node at the head end of the edge.
 o getKey()
Get the key for this edge.
 o getTail()
Get the node at the tail end of the edge.
 o getType()
Get the type of this element.
 o isEdge()
Check if this element is an edge.
 o printEdge(PrintWriter)
Print the edge description to the provided stream.
 o toString()
Get the String rendition of the edge.

Variables

 o defaultNamePrefix
 public static final String defaultNamePrefix
Default edge name prefix used by setName().

See Also:
setName

Constructors

 o Edge
 public Edge(Subgraph subg,
             Node tail,
             Node head)
Use this constructor when creating an edge.

Parameters:
subg - the parent subgraph.
tail - node anchoring the tail of the edge.
head - node anchoring the head of the edge.
 o Edge
 public Edge(Subgraph subg,
             Node tail,
             String tailPort,
             Node head,
             String headPort)
Use this constructor when creating an edge with ports.

Parameters:
subg - the parent subgraph.
tail - node anchoring the tail of the edge.
tailPort - the port to use within the tail node.
head - node anchoring the head of the edge.
headPort - the port to use within the head node.
 o Edge
 public Edge(Subgraph subg,
             Node tail,
             String tailPort,
             Node head,
             String headPort,
             String key) throws RuntimeException
Use this constructor when creating an edge requiring a key to distinguish it.

Parameters:
subg - the parent subgraph.
tail - node anchoring the tail of the edge.
tailPort - the port to use within the tail node.
head - node anchoring the head of the edge.
headPort - the port to use within the head node.
key - identifier (used in conjection with tail/head, but not ports) to uniquely define edge (and prevent unwanted duplicate from being created)

Methods

 o findEdgeByKey
 public static Edge findEdgeByKey(Node tail,
                                  Node head,
                                  String key)
Returns the edge with the given tail node, head node and key.

Parameters:
tail - the tail node of the desired edge.
head - the head node of the desired edge.
key - the key specifying the desired edge.
Returns:
the Edge matching the arguments or null, if there is no match.
See Also:
findEdgesByEnds
 o isEdge
 public boolean isEdge()
Check if this element is an edge. Useful for testing the subclass type of a Element object.

Returns:
true if this object is a Edge.
Overrides:
isEdge in class Element
 o getType
 public int getType()
Get the type of this element. Useful for distinguishing Element objects.

Returns:
the class variable constant Grappa.EDGE.
Overrides:
getType in class Element
See Also:
Grappa
 o free
 public void free()
Included to help speed release of valuable memory.

Overrides:
free in class Element
 o getKey
 public String getKey()
Get the key for this edge.

Returns:
the key of the edge
 o getHead
 public Node getHead()
Get the node at the head end of the edge.

Returns:
the head node of the edge
 o getTail
 public Node getTail()
Get the node at the tail end of the edge.

Returns:
the tail node of the edge
 o toString
 public String toString()
Get the String rendition of the edge.

Returns:
the string rendition of the edge, quoted as needed.
Overrides:
toString in class Element
 o printEdge
 public void printEdge(PrintWriter out)
Print the edge description to the provided stream.

Parameters:
out - the output stream for writing the description.
 o findEdgesByEnds
 public static Enumeration findEdgesByEnds(Node node1,
                                           Node node2)
Returns an enumeration of edges that have one end fixed at node1 and the other end at node2. If node2 is empty, an enumeration of all edges attached to node1 is returned.

Parameters:
node1 - one vertex of the set of edges to be returned
node2 - the other vertex of the set of edges to be returned, or null for no constraint on the other vertex
Returns:
an enumeration of Edge objects.

All Packages  Class Hierarchy  This Package  Previous  Next  Index