Class 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 Details

    • AbstractNode

      public AbstractNode​(Graph graph)
      Constructs a new AbstractNode. Sets the graph of the new AbstractNode.
      Parameters:
      graph - the Graph the new AbstractNode instance shall belong to.
    • AbstractNode

      public AbstractNode​(Graph graph, CollectionAttribute coll)
      Constructs a new AbstractNode. Sets the graph of the new AbstractNode.
      Parameters:
      graph - the Graph the new AbstractNode instance shall belong to.
      coll - the CollectionAttribute of the newly created AbstractNode instance.
  • Method Details

    • getAllInEdges

      public Collection<Edge> getAllInEdges()
      Description copied from interface: Node
      Union of getDirectedInEdges() and getUndirectedEdges() .
      Specified by:
      getAllInEdges in interface Node
      Returns:
      Collection
      See Also:
      Node.getAllInEdges()
    • getAllInNeighbors

      public Collection<Node> getAllInNeighbors()
      Description copied from interface: Node
      Union of getInNeighbors() and getUndirectedNeighbors() .
      Specified by:
      getAllInNeighbors in interface Node
      Returns:
      Collection
      See Also:
      Node.getAllInNeighbors()
    • getAllOutEdges

      public Collection<Edge> getAllOutEdges()
      Description copied from interface: Node
      Union of getDirectedOutEdges() and getUndirectedEdges() .
      Specified by:
      getAllOutEdges in interface Node
      Returns:
      Collection
      See Also:
      Node.getAllOutEdges()
    • getAllOutNeighbors

      public Collection<Node> getAllOutNeighbors()
      Description copied from interface: Node
      Union of getOutNeighbors() and getUndirectedNeighbors().
      Specified by:
      getAllOutNeighbors in interface Node
      Returns:
      Collection
      See Also:
      Node.getAllOutNeighbors()
    • getDirectedInEdges

      public Collection<Edge> getDirectedInEdges()
      Returns a collection containing the directed, ingoing edges of the Node.
      Specified by:
      getDirectedInEdges in interface Node
      Returns:
      a collection containing the directed, ingoing edges of the Node.
    • getDirectedOutEdges

      public Collection<Edge> getDirectedOutEdges()
      Returns a collection containing the directed outgoing edges of the Node.
      Specified by:
      getDirectedOutEdges in interface Node
      Returns:
      a collection containing the directed outgoing edges of the Node.
    • getEdges

      public Collection<Edge> getEdges()
      Returns a collection containing all the ingoing and outgoing directed and undirected edges of the current Node. Ingoing and outgoing edges will not be separated and there will be no ordering on the collection.
      Specified by:
      getEdges in interface Node
      Returns:
      a collection containing all ingoing and outgoing directed and undirected edges of the current Node.
    • getInDegree

      public int getInDegree()
      Returns the in-degree of the current Node. The in-degree is defined as the number of ingoing, directed edges plus the number of undirected edges.
      Specified by:
      getInDegree in interface Node
      Returns:
      the in-degree of the current Node.
    • getInNeighbors

      public Set<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 by getInDegree(), due to the fact that multiple edges between the same two nodes are possible but the corresponding Node is only inserted once.
      Specified by:
      getInNeighbors in interface Node
      Returns:
      a collection containing the neighbor nodes belonging to incoming edges.
    • getInNeighborsIterator

      public Iterator<Node> getInNeighborsIterator()
      Returns an iterator over the neighbor nodes belonging to incoming edges.
      Specified by:
      getInNeighborsIterator in interface Node
      Returns:
      an iterator over the neighbor nodes belonging to incoming edges.
    • getUndirectedNeighborsIterator

      public Iterator<Node> getUndirectedNeighborsIterator()
      Specified by:
      getUndirectedNeighborsIterator in interface Node
    • getNeighbors

      public Set<Node> getNeighbors()
      Returns a collection containing all the neighbor nodes of the current Node. A neighbor Node is either the source or the target of either an ingoing, outgoing or an undirected Edge of this Node.
      Specified by:
      getNeighbors in interface Node
      Returns:
      a collection containing all the neighbor nodes of the current Node.
    • getNeighborsIterator

      public Iterator<Node> getNeighborsIterator()
      Returns an interator over the neighbor nodes of the current Node. A neighbor nodes is either the source or the target of either an ingoing or outgoing or undirected Edge.
      Specified by:
      getNeighborsIterator in interface Node
      Returns:
      an iterator over the neighbor nodes of the current Node.
    • getOutDegree

      public int getOutDegree()
      Returns the out-degree of the current Node. The out-degree is defined as the number of outgoing, directed edges plus the number of undirected edges.
      Specified by:
      getOutDegree in interface Node
      Returns:
      the out-degree of the current Node.
    • getOutNeighbors

      public Set<Node> getOutNeighbors()
      Returns a collection containing all the neighbors of the current Node which are connected by an outgoing Edge. The number of Elements returned by this function might be less than the number returned by getOutDegree(), due to the fact that multiple edges between the same two nodes are possible but the corresponding Node is only inserted once.
      Specified by:
      getOutNeighbors in interface Node
      Returns:
      a collection containing all the neighbor nodes of the current Node connected by an outgoing Edge.
    • getOutNeighborsIterator

      public Iterator<Node> getOutNeighborsIterator()
      Returns an iterator containing all the neighbors of the current Node which are connected by an outgoing Edge.
      Specified by:
      getOutNeighborsIterator in interface Node
      Returns:
      a Iterator containing all the neighbor nodes of the current Node connected by an outgoing Edge.
    • getUndirectedEdges

      public Collection<Edge> getUndirectedEdges()
      Returns a collection containing the undirected edges of the Node.
      Specified by:
      getUndirectedEdges in interface Node
      Returns:
      a collection containing the undirected edges of the Node.
    • getUndirectedNeighbors

      public Collection<Node> getUndirectedNeighbors()
      Returns a collection containing all the neighbors which are connected to the current Node by an undirected Edge.
      Specified by:
      getUndirectedNeighbors in interface Node
      Returns:
      a collection containing all the neighbors which are connected to the current Node by an undirected Edge.