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
-
defaultNamePrefix
- Default edge name prefix used by setName().
-
Edge(Subgraph, Node, Node)
- Use this constructor when creating an edge.
-
Edge(Subgraph, Node, String, Node, String)
- Use this constructor when creating an edge with ports.
-
Edge(Subgraph, Node, String, Node, String, String)
- Use this constructor when creating an edge requiring a key to distinguish it.
-
findEdgeByKey(Node, Node, String)
- Returns the edge with the given tail node, head node and key.
-
findEdgesByEnds(Node, Node)
- Returns an enumeration of edges that have one end fixed at node1
and the other end at node2.
-
free()
- Included to help speed release of valuable memory.
-
getHead()
- Get the node at the head end of the edge.
-
getKey()
- Get the key for this edge.
-
getTail()
- Get the node at the tail end of the edge.
-
getType()
- Get the type of this element.
-
isEdge()
- Check if this element is an edge.
-
printEdge(PrintWriter)
- Print the edge description to the provided stream.
-
toString()
- Get the String rendition of the edge.
defaultNamePrefix
public static final String defaultNamePrefix
- Default edge name prefix used by setName().
- See Also:
- setName
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.
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.
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)
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
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
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
free
public void free()
- Included to help speed release of valuable memory.
- Overrides:
- free in class Element
getKey
public String getKey()
- Get the key for this edge.
- Returns:
- the key of the edge
getHead
public Node getHead()
- Get the node at the head end of the edge.
- Returns:
- the head node of the edge
getTail
public Node getTail()
- Get the node at the tail end of the edge.
- Returns:
- the tail node of the edge
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
printEdge
public void printEdge(PrintWriter out)
- Print the edge description to the provided stream.
- Parameters:
- out - the output stream for writing the description.
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