All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.Node
java.lang.Object
|
+----att.grappa.Element
|
+----att.grappa.Node
- public class Node
- extends Element
This class describes a node.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
defaultNamePrefix
- Default node name prefix used by setName().
-
Node(Subgraph)
- Use this constructor when creating a node within a subgraph
with an automatically generated name.
-
Node(Subgraph, String)
- Use this constructor when creating a node within a subgraph.
-
addEdge(Edge, boolean)
- Add the given edge to this node's inEdges or outEdges dictionaries,
if it is not already there.
-
edgeElements()
- Get an Enumeration of the edges directed to or from this node.
-
findInEdgeByKey(Node, String)
- Find an inbound edge given its tail and key.
-
findOutEdgeByKey(Node, String)
- Find an outbound edge given its head and key.
-
getType()
- Get the type of this element.
-
inEdgeElements()
- Get an Enumeration of the edges directed to this node.
-
isNode()
- Check if this element is a node.
-
outEdgeElements()
- Get an Enumeration of the edges directed from this node.
-
printNode(PrintWriter)
- Print the node description to the provided stream.
-
removeEdge(Edge, boolean)
- Remove the given edge from this node's inEdges or outEdges dictionaries.
defaultNamePrefix
public static final String defaultNamePrefix
- Default node name prefix used by setName().
- See Also:
- setName
Node
public Node(Subgraph subg,
String name)
- Use this constructor when creating a node within a subgraph.
- Parameters:
- subg - the parent subgraph.
- name - the name of this node.
Node
public Node(Subgraph subg)
- Use this constructor when creating a node within a subgraph
with an automatically generated name.
- Parameters:
- subg - the parent subgraph.
- See Also:
- setName
isNode
public boolean isNode()
- Check if this element is a node.
Useful for testing the subclass type of an Element object.
- Returns:
- true if this object is a Node.
- Overrides:
- isNode in class Element
getType
public int getType()
- Get the type of this element.
Useful for distinguishing among Element objects.
- Returns:
- the class variable constant Grappa.NODE
- Overrides:
- getType in class Element
- See Also:
- NODE
addEdge
public synchronized void addEdge(Edge edge,
boolean inEdge)
- Add the given edge to this node's inEdges or outEdges dictionaries,
if it is not already there.
The boolean indicates whether the edge terminates at (inEdge) or
emanates from (outEdge) the node.
- Parameters:
- edge - the edge to be added to this node's dictionary.
- inEdge - if set true, add to inEdges dictionary otherwise add
to outEdges dictionary.
- See Also:
- Edge
findOutEdgeByKey
public Edge findOutEdgeByKey(Node head,
String key)
- Find an outbound edge given its head and key.
- Parameters:
- head - the Node at the head of the edge
- key - the key String associated with the edge
- Returns:
- the matching edge or null
findInEdgeByKey
public Edge findInEdgeByKey(Node tail,
String key)
- Find an inbound edge given its tail and key.
- Parameters:
- tail - the Node at the tail of the edge
- key - the key String associated with the edge
- Returns:
- the matching edge or null
removeEdge
public synchronized void removeEdge(Edge edge,
boolean inEdge)
- Remove the given edge from this node's inEdges or outEdges dictionaries.
The boolean indicates whether the edge terminates at (inEdge) or
emanates from (outEdge) the node.
- Parameters:
- edge - the edge to be removed from this node's dictionary.
- inEdge - if set true, remove from inEdges dictionary otherwise
remove from outEdges dictionary.
- See Also:
- Edge
printNode
public void printNode(PrintWriter out)
- Print the node description to the provided stream.
- Parameters:
- out - the output text stream for writing the description.
edgeElements
public Enumeration edgeElements()
- Get an Enumeration of the edges directed to or from this node.
- Returns:
- an Enumeration of all the edges (in or out) associated with this node.
inEdgeElements
public Enumeration inEdgeElements()
- Get an Enumeration of the edges directed to this node.
- Returns:
- an Enumeration of all the inbound edges associated with this node.
outEdgeElements
public Enumeration outEdgeElements()
- Get an Enumeration of the edges directed from this node.
- Returns:
- an Enumeration of all the outbound edges associated with this node.
All Packages Class Hierarchy This Package Previous Next Index