Package net.ggtools.grand.graph
Class NodeImpl
- java.lang.Object
-
- net.ggtools.grand.graph.NodeImpl
-
- All Implemented Interfaces:
GraphObject,Node
- Direct Known Subclasses:
AntTargetNode
public class NodeImpl extends Object implements Node
- Author:
- Christophe Labouisse
-
-
Field Summary
-
Fields inherited from interface net.ggtools.grand.graph.GraphObject
ATTR_ALL, ATTR_NONE
-
Fields inherited from interface net.ggtools.grand.graph.Node
ATTR_CONDITIONAL_NODE, ATTR_MAIN_NODE, ATTR_MISSING_NODE, ATTR_PREFIXED_NODE, ATTR_START_NODE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(NodeVisitor visitor)Method accept.voidaddBackLink(Link link)Method addBackLink.voidaddLink(Link link)Method addLink.voidclearAttributes(int attributeMask)Method clearAttributes.booleanequals(Object obj)Returns true of the current object andobjare equals.intgetAttributes()Method getAttributes.Collection<Link>getBackLinks()Method getBackLinks.StringgetDescription()Method getDescription.GraphgetGraph()Method getGraph.Collection<Link>getLinks()Method getLinks.StringgetName()Method getName.StringgetSource()Method getSource.booleanhasAttributes(int attributeMask)Method hasAttributes.inthashCode()Compute a hash code for the current node.voidremoveBackLink(Link link)Method removeBackLink.voidremoveLink(Link link)Method removeLink.voidsetAttributes(int attributeMask)Method setAttributes.voidsetDescription(String desc)Method setDescription.voidsetSource(String newSource)Sets the source snippet for the node.StringtoString()Method toString.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ggtools.grand.graph.GraphObject
clearAttributes, getAttributes, hasAttributes, setAttributes
-
-
-
-
Method Detail
-
equals
public final boolean equals(Object obj)
Returns true of the current object andobjare equals. Two Nodes are equals when they belong to the same graph and they have the same name.- Overrides:
equalsin classObject- Parameters:
obj- object to compare the node to.- Returns:
- true if this is equal to obj.
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public final int hashCode()
Compute a hash code for the current node. A Node's hash will be his name's hashcode.- Overrides:
hashCodein classObject- Returns:
- hash code for the current node.
- See Also:
Object.hashCode()
-
toString
public final String toString()
Method toString.- Overrides:
toStringin classObject- Returns:
- String
- See Also:
Object.toString()
-
getLinks
public final Collection<Link> getLinks()
Method getLinks.- Specified by:
getLinksin interfaceNode- Returns:
- Collection<Link>
- See Also:
Node.getLinks()
-
getBackLinks
public final Collection<Link> getBackLinks()
Method getBackLinks.- Specified by:
getBackLinksin interfaceNode- Returns:
- Collection<Link>
- See Also:
Node.getBackLinks()
-
getDescription
public final String getDescription()
Method getDescription.- Specified by:
getDescriptionin interfaceNode- Returns:
- String
- See Also:
Node.getDescription()
-
setDescription
public final void setDescription(String desc)
Method setDescription.- Specified by:
setDescriptionin interfaceNode- Parameters:
desc- String- See Also:
Node.setDescription(java.lang.String)
-
getGraph
public final Graph getGraph()
Method getGraph.- Specified by:
getGraphin interfaceGraphObject- Returns:
- Graph
- See Also:
GraphObject.getGraph()
-
getName
public final String getName()
Method getName.- Specified by:
getNamein interfaceGraphObject- Returns:
- String
- See Also:
GraphObject.getName()
-
addLink
public final void addLink(Link link)
Method addLink.- Specified by:
addLinkin interfaceNode- Parameters:
link- Link- See Also:
Node.addLink(net.ggtools.grand.graph.Link)
-
addBackLink
public final void addBackLink(Link link)
Method addBackLink.- Specified by:
addBackLinkin interfaceNode- Parameters:
link- Link- See Also:
Node.addBackLink(net.ggtools.grand.graph.Link)
-
removeLink
public final void removeLink(Link link)
Method removeLink.- Specified by:
removeLinkin interfaceNode- Parameters:
link- Link- See Also:
Node.removeLink(net.ggtools.grand.graph.Link)
-
removeBackLink
public final void removeBackLink(Link link)
Method removeBackLink.- Specified by:
removeBackLinkin interfaceNode- Parameters:
link- Link- See Also:
Node.removeBackLink(net.ggtools.grand.graph.Link)
-
accept
public void accept(NodeVisitor visitor)
Method accept.- Specified by:
acceptin interfaceNode- Parameters:
visitor- NodeVisitor- See Also:
Node.accept(net.ggtools.grand.graph.visit.NodeVisitor)
-
getSource
public final String getSource()
Method getSource.- Specified by:
getSourcein interfaceNode- Returns:
- String
- See Also:
Node.getSource()
-
setSource
public final void setSource(String newSource)
Sets the source snippet for the node.- Parameters:
newSource- String
-
setAttributes
public void setAttributes(int attributeMask)
Method setAttributes.- Specified by:
setAttributesin interfaceGraphObject- Parameters:
attributeMask- int- See Also:
GraphObject.setAttributes(int)
-
getAttributes
public int getAttributes()
Method getAttributes.- Specified by:
getAttributesin interfaceGraphObject- Returns:
- int
- See Also:
GraphObject.getAttributes()
-
clearAttributes
public void clearAttributes(int attributeMask)
Method clearAttributes.- Specified by:
clearAttributesin interfaceGraphObject- Parameters:
attributeMask- int- See Also:
GraphObject.clearAttributes(int)
-
hasAttributes
public boolean hasAttributes(int attributeMask)
Method hasAttributes.- Specified by:
hasAttributesin interfaceGraphObject- Parameters:
attributeMask- int- Returns:
- boolean
- See Also:
GraphObject.hasAttributes(int)
-
-