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

Variable Index

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

Constructor Index

 o Node(Subgraph)
Use this constructor when creating a node within a subgraph with an automatically generated name.
 o Node(Subgraph, String)
Use this constructor when creating a node within a subgraph.

Method Index

 o addEdge(Edge, boolean)
Add the given edge to this node's inEdges or outEdges dictionaries, if it is not already there.
 o edgeElements()
Get an Enumeration of the edges directed to or from this node.
 o findInEdgeByKey(Node, String)
Find an inbound edge given its tail and key.
 o findOutEdgeByKey(Node, String)
Find an outbound edge given its head and key.
 o getType()
Get the type of this element.
 o inEdgeElements()
Get an Enumeration of the edges directed to this node.
 o isNode()
Check if this element is a node.
 o outEdgeElements()
Get an Enumeration of the edges directed from this node.
 o printNode(PrintWriter)
Print the node description to the provided stream.
 o removeEdge(Edge, boolean)
Remove the given edge from this node's inEdges or outEdges dictionaries.

Variables

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

See Also:
setName

Constructors

 o 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.
 o 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

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o printNode
 public void printNode(PrintWriter out)
Print the node description to the provided stream.

Parameters:
out - the output text stream for writing the description.
 o 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.
 o 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.
 o 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