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 void
accept(NodeVisitor visitor)
Method accept.void
addBackLink(Link link)
Method addBackLink.void
addLink(Link link)
Method addLink.void
clearAttributes(int attributeMask)
Method clearAttributes.boolean
equals(Object obj)
Returns true of the current object andobj
are equals.int
getAttributes()
Method getAttributes.Collection<Link>
getBackLinks()
Method getBackLinks.String
getDescription()
Method getDescription.Graph
getGraph()
Method getGraph.Collection<Link>
getLinks()
Method getLinks.String
getName()
Method getName.String
getSource()
Method getSource.boolean
hasAttributes(int attributeMask)
Method hasAttributes.int
hashCode()
Compute a hash code for the current node.void
removeBackLink(Link link)
Method removeBackLink.void
removeLink(Link link)
Method removeLink.void
setAttributes(int attributeMask)
Method setAttributes.void
setDescription(String desc)
Method setDescription.void
setSource(String newSource)
Sets the source snippet for the node.String
toString()
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 andobj
are equals. Two Nodes are equals when they belong to the same graph and they have the same name.- Overrides:
equals
in 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:
hashCode
in classObject
- Returns:
- hash code for the current node.
- See Also:
Object.hashCode()
-
toString
public final String toString()
Method toString.- Overrides:
toString
in classObject
- Returns:
- String
- See Also:
Object.toString()
-
getLinks
public final Collection<Link> getLinks()
Method getLinks.- Specified by:
getLinks
in interfaceNode
- Returns:
- Collection<Link>
- See Also:
Node.getLinks()
-
getBackLinks
public final Collection<Link> getBackLinks()
Method getBackLinks.- Specified by:
getBackLinks
in interfaceNode
- Returns:
- Collection<Link>
- See Also:
Node.getBackLinks()
-
getDescription
public final String getDescription()
Method getDescription.- Specified by:
getDescription
in interfaceNode
- Returns:
- String
- See Also:
Node.getDescription()
-
setDescription
public final void setDescription(String desc)
Method setDescription.- Specified by:
setDescription
in interfaceNode
- Parameters:
desc
- String- See Also:
Node.setDescription(java.lang.String)
-
getGraph
public final Graph getGraph()
Method getGraph.- Specified by:
getGraph
in interfaceGraphObject
- Returns:
- Graph
- See Also:
GraphObject.getGraph()
-
getName
public final String getName()
Method getName.- Specified by:
getName
in interfaceGraphObject
- Returns:
- String
- See Also:
GraphObject.getName()
-
addLink
public final void addLink(Link link)
Method addLink.- Specified by:
addLink
in interfaceNode
- Parameters:
link
- Link- See Also:
Node.addLink(net.ggtools.grand.graph.Link)
-
addBackLink
public final void addBackLink(Link link)
Method addBackLink.- Specified by:
addBackLink
in interfaceNode
- Parameters:
link
- Link- See Also:
Node.addBackLink(net.ggtools.grand.graph.Link)
-
removeLink
public final void removeLink(Link link)
Method removeLink.- Specified by:
removeLink
in interfaceNode
- Parameters:
link
- Link- See Also:
Node.removeLink(net.ggtools.grand.graph.Link)
-
removeBackLink
public final void removeBackLink(Link link)
Method removeBackLink.- Specified by:
removeBackLink
in interfaceNode
- Parameters:
link
- Link- See Also:
Node.removeBackLink(net.ggtools.grand.graph.Link)
-
accept
public void accept(NodeVisitor visitor)
Method accept.- Specified by:
accept
in interfaceNode
- Parameters:
visitor
- NodeVisitor- See Also:
Node.accept(net.ggtools.grand.graph.visit.NodeVisitor)
-
getSource
public final String getSource()
Method getSource.- Specified by:
getSource
in 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:
setAttributes
in interfaceGraphObject
- Parameters:
attributeMask
- int- See Also:
GraphObject.setAttributes(int)
-
getAttributes
public int getAttributes()
Method getAttributes.- Specified by:
getAttributes
in interfaceGraphObject
- Returns:
- int
- See Also:
GraphObject.getAttributes()
-
clearAttributes
public void clearAttributes(int attributeMask)
Method clearAttributes.- Specified by:
clearAttributes
in interfaceGraphObject
- Parameters:
attributeMask
- int- See Also:
GraphObject.clearAttributes(int)
-
hasAttributes
public boolean hasAttributes(int attributeMask)
Method hasAttributes.- Specified by:
hasAttributes
in interfaceGraphObject
- Parameters:
attributeMask
- int- Returns:
- boolean
- See Also:
GraphObject.hasAttributes(int)
-
-