public abstract class AbstractNode extends AbstractElement implements Node
This class provides a basic implementation of Node interface, to
minimize the effort required to implement this interface.
This class implements all the methods of
AbstractElement and most of the
methods of Node (there are "only" ten abstract
methods). In addition to these, subclasses must provide implementations for
addEdgeCallback(AbstractEdge) and
removeEdgeCallback(AbstractEdge) which are called by the parent
graph when an edge incident to this node is added to or removed from the
graph. This class has a low memory overhead (one reference as field).
AbstractElement.AttributeChangeEvent| Modifier and Type | Method and Description |
|---|---|
java.util.Iterator<Node> |
getBreadthFirstIterator()
This implementation creates an instance of
BreadthFirstIterator and returns it. |
java.util.Iterator<Node> |
getBreadthFirstIterator(boolean directed)
This implementation creates an instance of
BreadthFirstIterator and returns it. |
java.util.Iterator<Node> |
getDepthFirstIterator()
This implementation creates an instance of
DepthFirstIterator and returns it. |
java.util.Iterator<Node> |
getDepthFirstIterator(boolean directed)
This implementation creates an instance of
DepthFirstIterator and returns it. |
Edge |
getEdgeBetween(int index)
This implementation uses
Node.getEdgeBetween(Node) |
Edge |
getEdgeBetween(java.lang.String id)
This implementation uses
Node.getEdgeBetween(Node) |
Edge |
getEdgeFrom(int index)
This implementation uses
Node.getEdgeFrom(Node) |
Edge |
getEdgeFrom(java.lang.String id)
This implementation uses
Node.getEdgeFrom(Node) |
Edge |
getEdgeToward(int index)
This implementation uses
Node.getEdgeToward(Node) |
Edge |
getEdgeToward(java.lang.String id)
This implementation uses
Node.getEdgeToward(Node) |
Graph |
getGraph()
This implementation returns
graph. |
boolean |
isEnteringEdge(Edge e)
Checks if an edge enters this node.
|
boolean |
isIncidentEdge(Edge e)
Checks if an edge is incident to this node.
|
boolean |
isLeavingEdge(Edge e)
Checks if an edge leaves this node.
|
attributeKeys, clearAttributes, getAttribute, getAttribute, getAttributeCount, getFirstAttributeOf, getFirstAttributeOf, getId, getIndex, hasAttribute, hasAttribute, removeAttribute, setAttribute, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitedges, enteringEdges, getDegree, getEdge, getEdgeBetween, getEdgeFrom, getEdgeToward, getEnteringEdge, getInDegree, getLeavingEdge, getOutDegree, hasEdgeBetween, hasEdgeBetween, hasEdgeBetween, hasEdgeFrom, hasEdgeFrom, hasEdgeFrom, hasEdgeToward, hasEdgeToward, hasEdgeToward, iterator, leavingEdges, neighborNodes, toStringattributeKeys, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getFirstAttributeOf, getFirstAttributeOf, getId, getIndex, getLabel, getMap, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasLabel, hasMap, hasNumber, hasVector, removeAttribute, setAttribute, setAttributespublic Graph getGraph()
graph.getGraph in interface NodeNode.getGraph()public Edge getEdgeToward(int index)
Node.getEdgeToward(Node)getEdgeToward in interface Nodeindex - Index of the target node.Node.getEdgeToward(int)public Edge getEdgeToward(java.lang.String id)
Node.getEdgeToward(Node)getEdgeToward in interface Nodeid - Identifier of the target node.Node.getEdgeToward(java.lang.String)public Edge getEdgeFrom(int index)
Node.getEdgeFrom(Node)getEdgeFrom in interface Nodeindex - Index of the source node.Node.getEdgeFrom(int)public Edge getEdgeFrom(java.lang.String id)
Node.getEdgeFrom(Node)getEdgeFrom in interface Nodeid - Identifier of the source node.Node.getEdgeFrom(java.lang.String)public Edge getEdgeBetween(int index)
Node.getEdgeBetween(Node)getEdgeBetween in interface Nodeindex - The index of the opposite node.Node.getEdgeBetween(int)public Edge getEdgeBetween(java.lang.String id)
Node.getEdgeBetween(Node)getEdgeBetween in interface Nodeid - Identifier of the opposite node.Node.getEdgeBetween(java.lang.String)public java.util.Iterator<Node> getBreadthFirstIterator()
BreadthFirstIterator and returns it.getBreadthFirstIterator in interface NodeNode.getBreadthFirstIterator()public java.util.Iterator<Node> getBreadthFirstIterator(boolean directed)
BreadthFirstIterator and returns it.getBreadthFirstIterator in interface Nodedirected - If false, the iterator will ignore edge orientation (the default
is "True").Node.getBreadthFirstIterator(boolean)public java.util.Iterator<Node> getDepthFirstIterator()
DepthFirstIterator and returns it.getDepthFirstIterator in interface NodeNode.getDepthFirstIterator()public java.util.Iterator<Node> getDepthFirstIterator(boolean directed)
DepthFirstIterator and returns it.getDepthFirstIterator in interface Nodedirected - If false, the iterator will ignore edge orientation (the default
is "True").Node.getDepthFirstIterator(boolean)public boolean isEnteringEdge(Edge e)
e - an edgetrue if e is entering edge for this node.public boolean isLeavingEdge(Edge e)
e - an edgetrue if e is leaving edge for this node.public boolean isIncidentEdge(Edge e)
e - an edgetrue if e is incident edge for this node.