Package org.graffiti.graph
Class AbstractNode
java.lang.Object
org.graffiti.attributes.AbstractAttributable
org.graffiti.graph.AbstractGraphElement
org.graffiti.graph.AbstractNode
- All Implemented Interfaces:
Comparable<GraphElement>,Attributable,GraphElement,Node
- Direct Known Subclasses:
AdjListNode
public abstract class AbstractNode extends AbstractGraphElement implements Node
Abstract class
AbstractNode common functionality for
Node implementations.- Version:
- $Revision: 1.12 $
- See Also:
AdjListNode
-
Constructor Summary
Constructors Constructor Description AbstractNode(Graph graph)Constructs a newAbstractNode.AbstractNode(Graph graph, CollectionAttribute coll)Constructs a newAbstractNode. -
Method Summary
Modifier and Type Method Description Collection<Edge>getAllInEdges()Union ofgetDirectedInEdges()andgetUndirectedEdges().Collection<Node>getAllInNeighbors()Union ofgetInNeighbors()andgetUndirectedNeighbors().Collection<Edge>getAllOutEdges()Union ofgetDirectedOutEdges()andgetUndirectedEdges().Collection<Node>getAllOutNeighbors()Union ofgetOutNeighbors()andgetUndirectedNeighbors().Collection<Edge>getDirectedInEdges()Returns a collection containing the directed, ingoing edges of theNode.Collection<Edge>getDirectedOutEdges()Returns a collection containing the directed outgoing edges of theNode.Collection<Edge>getEdges()Returns a collection containing all the ingoing and outgoing directed and undirected edges of the currentNode.intgetInDegree()Returns the in-degree of the currentNode.Set<Node>getInNeighbors()Returns a collection containing the neighbor nodes belonging to incoming edges.Iterator<Node>getInNeighborsIterator()Returns an iterator over the neighbor nodes belonging to incoming edges.Set<Node>getNeighbors()Returns a collection containing all the neighbor nodes of the currentNode.Iterator<Node>getNeighborsIterator()Returns an interator over the neighbor nodes of the currentNode.intgetOutDegree()Returns the out-degree of the currentNode.Set<Node>getOutNeighbors()Returns a collection containing all the neighbors of the currentNodewhich are connected by an outgoingEdge.Iterator<Node>getOutNeighborsIterator()Returns an iterator containing all the neighbors of the currentNodewhich are connected by an outgoingEdge.Collection<Edge>getUndirectedEdges()Returns a collection containing the undirected edges of theNode.Collection<Node>getUndirectedNeighbors()Returns a collection containing all the neighbors which are connected to the currentNodeby an undirectedEdge.Iterator<Node>getUndirectedNeighborsIterator()Methods inherited from class org.graffiti.graph.AbstractGraphElement
compareTo, getGraph, getID, getListenerManager, getViewID, setID, setViewIDMethods inherited from class org.graffiti.attributes.AbstractAttributable
addAttribute, addBoolean, addByte, addDouble, addFloat, addInteger, addLong, addShort, addString, changeBoolean, changeByte, changeDouble, changeFloat, changeInteger, changeLong, changeShort, changeString, getAttribute, getAttributes, getBoolean, getByte, getDouble, getFloat, getInteger, getLong, getShort, getString, removeAttribute, setBoolean, setByte, setDouble, setFloat, setInteger, setLong, setShort, setStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graffiti.attributes.Attributable
addAttribute, addBoolean, addByte, addDouble, addFloat, addInteger, addLong, addShort, addString, changeBoolean, changeByte, changeDouble, changeFloat, changeInteger, changeLong, changeShort, changeString, getAttribute, getAttributes, getBoolean, getByte, getDouble, getFloat, getInteger, getListenerManager, getLong, getShort, getString, removeAttribute, setBoolean, setByte, setDouble, setFloat, setInteger, setLong, setShort, setStringMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.graffiti.graph.GraphElement
getGraph, getID, getViewID, setID, setViewIDMethods inherited from interface org.graffiti.graph.Node
getDegree, getDirectedInEdgesIterator, getDirectedOutEdgesIterator, getEdgesIterator, getUndirectedEdgesIterator, setGraph
-
Constructor Details
-
AbstractNode
Constructs a newAbstractNode. Sets the graph of the newAbstractNode.- Parameters:
graph- theGraphthe newAbstractNodeinstance shall belong to.
-
AbstractNode
Constructs a newAbstractNode. Sets the graph of the newAbstractNode.- Parameters:
graph- theGraphthe newAbstractNodeinstance shall belong to.coll- theCollectionAttributeof the newly createdAbstractNodeinstance.
-
-
Method Details
-
getAllInEdges
Description copied from interface:NodeUnion ofgetDirectedInEdges()andgetUndirectedEdges().- Specified by:
getAllInEdgesin interfaceNode- Returns:
- Collection
- See Also:
Node.getAllInEdges()
-
getAllInNeighbors
Description copied from interface:NodeUnion ofgetInNeighbors()andgetUndirectedNeighbors().- Specified by:
getAllInNeighborsin interfaceNode- Returns:
- Collection
- See Also:
Node.getAllInNeighbors()
-
getAllOutEdges
Description copied from interface:NodeUnion ofgetDirectedOutEdges()andgetUndirectedEdges().- Specified by:
getAllOutEdgesin interfaceNode- Returns:
- Collection
- See Also:
Node.getAllOutEdges()
-
getAllOutNeighbors
Description copied from interface:NodeUnion ofgetOutNeighbors()andgetUndirectedNeighbors().- Specified by:
getAllOutNeighborsin interfaceNode- Returns:
- Collection
- See Also:
Node.getAllOutNeighbors()
-
getDirectedInEdges
Returns a collection containing the directed, ingoing edges of theNode.- Specified by:
getDirectedInEdgesin interfaceNode- Returns:
- a collection containing the directed, ingoing edges of the
Node.
-
getDirectedOutEdges
Returns a collection containing the directed outgoing edges of theNode.- Specified by:
getDirectedOutEdgesin interfaceNode- Returns:
- a collection containing the directed outgoing edges of the
Node.
-
getEdges
Returns a collection containing all the ingoing and outgoing directed and undirected edges of the currentNode. Ingoing and outgoing edges will not be separated and there will be no ordering on the collection. -
getInDegree
public int getInDegree()Returns the in-degree of the currentNode. The in-degree is defined as the number of ingoing, directed edges plus the number of undirected edges.- Specified by:
getInDegreein interfaceNode- Returns:
- the in-degree of the current
Node.
-
getInNeighbors
Returns a collection containing the neighbor nodes belonging to incoming edges. The number of Elements returned by this function might be less than the number returned bygetInDegree(), due to the fact that multiple edges between the same two nodes are possible but the correspondingNodeis only inserted once.- Specified by:
getInNeighborsin interfaceNode- Returns:
- a collection containing the neighbor nodes belonging to incoming edges.
-
getInNeighborsIterator
Returns an iterator over the neighbor nodes belonging to incoming edges.- Specified by:
getInNeighborsIteratorin interfaceNode- Returns:
- an iterator over the neighbor nodes belonging to incoming edges.
-
getUndirectedNeighborsIterator
- Specified by:
getUndirectedNeighborsIteratorin interfaceNode
-
getNeighbors
Returns a collection containing all the neighbor nodes of the currentNode. A neighborNodeis either the source or the target of either an ingoing, outgoing or an undirectedEdgeof thisNode.- Specified by:
getNeighborsin interfaceNode- Returns:
- a collection containing all the neighbor nodes of the current
Node.
-
getNeighborsIterator
Returns an interator over the neighbor nodes of the currentNode. A neighbor nodes is either the source or the target of either an ingoing or outgoing or undirectedEdge.- Specified by:
getNeighborsIteratorin interfaceNode- Returns:
- an iterator over the neighbor nodes of the current
Node.
-
getOutDegree
public int getOutDegree()Returns the out-degree of the currentNode. The out-degree is defined as the number of outgoing, directed edges plus the number of undirected edges.- Specified by:
getOutDegreein interfaceNode- Returns:
- the out-degree of the current
Node.
-
getOutNeighbors
Returns a collection containing all the neighbors of the currentNodewhich are connected by an outgoingEdge. The number of Elements returned by this function might be less than the number returned bygetOutDegree(), due to the fact that multiple edges between the same two nodes are possible but the correspondingNodeis only inserted once.- Specified by:
getOutNeighborsin interfaceNode- Returns:
- a collection containing all the neighbor nodes of the current
Nodeconnected by an outgoingEdge.
-
getOutNeighborsIterator
Returns an iterator containing all the neighbors of the currentNodewhich are connected by an outgoingEdge.- Specified by:
getOutNeighborsIteratorin interfaceNode- Returns:
- a Iterator containing all the neighbor nodes of the current
Nodeconnected by an outgoingEdge.
-
getUndirectedEdges
Returns a collection containing the undirected edges of theNode.- Specified by:
getUndirectedEdgesin interfaceNode- Returns:
- a collection containing the undirected edges of the
Node.
-
getUndirectedNeighbors
Returns a collection containing all the neighbors which are connected to the currentNodeby an undirectedEdge.- Specified by:
getUndirectedNeighborsin interfaceNode- Returns:
- a collection containing all the neighbors which are connected to the
current
Nodeby an undirectedEdge.
-