net.ggtools.grand.graph
Interface Node

All Superinterfaces:
GraphObject
All Known Implementing Classes:
AntTargetNode, NodeImpl

public interface Node
extends GraphObject

Interface implementated by nodes populating the graph.

Author:
Christophe Labouisse

Field Summary
static int ATTR_CONDITIONAL_NODE
          Attribute bit to be set on conditional nodes.
static int ATTR_MAIN_NODE
          Attribute bit to be set on main nodes.
static int ATTR_MISSING_NODE
          Attribute bit to be set on missing nodes, that is nodes created by the graph producer even if no such node exists in the original data source.
static int ATTR_START_NODE
          Attribute bit to be set on the start node(s).
 
Fields inherited from interface net.ggtools.grand.graph.GraphObject
ATTR_ALL, ATTR_NONE
 
Method Summary
 void accept(NodeVisitor visitor)
          Accepts a visitor.
 void addBackLink(Link link)
          Add a link to the node.
 void addLink(Link link)
          Add a link to the node.
 java.util.Collection getBackLinks()
          Returns links coming to the node.
 java.lang.String getDescription()
          Returns a short description (one line of less) of the node.
 java.util.Collection getLinks()
          Returns links originating from the node.
 java.lang.String getSource()
          Returns the source snippet for the node.
 void removeBackLink(Link link)
          Remove a link from the node.
 void removeLink(Link link)
          Remove a link from the node.
 void setDescription(java.lang.String description)
          Sets the node's description.
 
Methods inherited from interface net.ggtools.grand.graph.GraphObject
clearAttributes, getAttributes, getGraph, getName, hasAttributes, setAttributes
 

Field Detail

ATTR_MAIN_NODE

static final int ATTR_MAIN_NODE
Attribute bit to be set on main nodes. The definition of a main node depends on the graph's source. For Ant a main node will be a target with a description attribute.

See Also:
Constant Field Values

ATTR_MISSING_NODE

static final int ATTR_MISSING_NODE
Attribute bit to be set on missing nodes, that is nodes created by the graph producer even if no such node exists in the original data source. The cause of such creations depends on the graph's source. For ant projects, missing nodes may be created when a target (or an antcall) refers a non existing node.

See Also:
Constant Field Values

ATTR_CONDITIONAL_NODE

static final int ATTR_CONDITIONAL_NODE
Attribute bit to be set on conditional nodes. A node is conditional if the whole content's execution is subject to a condition such like targets in ant with a if or unless attribute set.

See Also:
Constant Field Values

ATTR_START_NODE

static final int ATTR_START_NODE
Attribute bit to be set on the start node(s). The definition of a start node depends of the graph's source. For Ant a the start node is the default target.

See Also:
Constant Field Values
Method Detail

getLinks

java.util.Collection getLinks()
Returns links originating from the node. The implementing class should insure that the returned list only contains objects implementing the Link interface. The returned collection should allow modification operations.

Returns:
list of links.

getBackLinks

java.util.Collection getBackLinks()
Returns links coming to the node. The implementing class should insure that the returned list only contains objects implementing the Link interface. The returned collection should allow modification operations.

Returns:
list of links.

addLink

void addLink(Link link)
Add a link to the node. This method should be called when the link starts from the node. The implementations should try to preserve the order in which the nodes were added.

Parameters:
link - link to add

addBackLink

void addBackLink(Link link)
Add a link to the node. This method should be called when the link ends at the node. The implementations should try to preserve the order in which the nodes were added.

Parameters:
link - link to add

removeLink

void removeLink(Link link)
Remove a link from the node. This method should be called when the link starts from the node.

Parameters:
link - link to remove

removeBackLink

void removeBackLink(Link link)
Remove a link from the node. This method should be called when the link ends at the node.

Parameters:
link - link to remove

getDescription

java.lang.String getDescription()
Returns a short description (one line of less) of the node.

Returns:
description.

setDescription

void setDescription(java.lang.String description)
Sets the node's description.

Parameters:
description - node's description

accept

void accept(NodeVisitor visitor)
Accepts a visitor. The implementation should call the appropriate visitNode method of the visitor.

Parameters:
visitor -

getSource

java.lang.String getSource()
Returns the source snippet for the node. Implementations may return null if no source is available or if the source concept is not relevant.

Returns:
The source snippet for the node or null;


Copyright © 2004-2005 ggTools. All Rights Reserved.