Interface Node

All Superinterfaces:
Attributable, Comparable<GraphElement>, GraphElement
All Known Implementing Classes:
AbstractNode, AdjListNode, MergedNode, NodeHelper

public interface Node
extends GraphElement
Provides an interfaces for a graph node. All directed edges whose source is the current Node are regarded as outgoing edges. Ingoing edges are those directed edges whose target is the current Node. Undirected edges are regarded separately since a Graph can have both directed and indirected edges.
Version:
$Revision: 1.6 $
See Also:
Edge, GraphElement, Graph
  • Method Details

    • getAllInEdges

      Collection<Edge> getAllInEdges()
      Union of getDirectedInEdges() and getUndirectedEdges() .
      Returns:
      Collection
    • getAllInNeighbors

      Collection<Node> getAllInNeighbors()
      Union of getInNeighbors() and getUndirectedNeighbors() .
      Returns:
      Collection
    • getAllOutEdges

      Collection<Edge> getAllOutEdges()
      Union of getDirectedOutEdges() and getUndirectedEdges() .
      Returns:
      Collection
    • getAllOutNeighbors

      Collection<Node> getAllOutNeighbors()
      Union of getOutNeighbors() and getUndirectedNeighbors().
      Returns:
      Collection
    • getDirectedInEdges

      Collection<Edge> getDirectedInEdges()
      Returns a collection containing the directed ingoing edges of the Node.
      Returns:
      a collection containing the directed ingoing edges of the Node.
    • getDirectedInEdgesIterator

      Iterator<Edge> getDirectedInEdgesIterator()
      Returns an iterator containing the directed ingoing edges of the Node.
      Returns:
      an iterator containing the directed ingoing edges of the Node.
    • getDirectedOutEdges

      Collection<Edge> getDirectedOutEdges()
      Returns a collection containing the outgoing directed edges of the Node.
      Returns:
      a collection containing the outgoing directed edges of the Node.
    • getDirectedOutEdgesIterator

      Iterator<Edge> getDirectedOutEdgesIterator()
      Returns an iterator containing the outgoing directed edges of the Node.
      Returns:
      an iterator containing the outgoing directed edges of the Node.
    • getEdges

      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.
      Returns:
      a collection containing all ingoing and outgoing directed and undirected edges of the current Node.
    • getEdgesIterator

      Iterator<Edge> getEdgesIterator()
      Returns an iterator 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.
      Returns:
      an iterator containing all ingoing and outgoing directed and undirected edges of the current Node.
    • getInDegree

      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.
      Returns:
      the in-degree of the current Node.
    • getInNeighbors

      Set<Node> getInNeighbors()
      Returns a collection containing the neighbor nodes belonging to incoming edges. Note that 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.
      Returns:
      a collection containing the neighbor nodes belonging to incoming edges.
    • getInNeighborsIterator

      Iterator<Node> getInNeighborsIterator()
      Returns an iterator over the neighbor nodes belonging to incoming edges.
      Returns:
      a Iterator over the neighbor nodes belonging to incoming edges.
    • getNeighbors

      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 or an outgoing or an undirected Edge.
      Returns:
      a collection containing all the neighbor nodes of the current Node.
    • getNeighborsIterator

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

      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.
      Returns:
      the out-degree of the current Node.
    • getOutNeighbors

      Set<Node> getOutNeighbors()
      Returns a collection containing all the neighbors of the current Node which are connected by an outgoing Edge. Note that 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.
      Returns:
      a collection containing all the neighbor nodes of the current Node connected by an outgoing Edge.
    • getOutNeighborsIterator

      Iterator<Node> getOutNeighborsIterator()
      Returns an iterator containing all the neighbors of the current Node which are connected by an outgoing Edge.
      Returns:
      an iterator containing all the neighbor Nodes of the current Node connected by an outgoing Edge.
    • getUndirectedEdges

      Collection<Edge> getUndirectedEdges()
      Returns a collection containing the undirected ingoing and outgoing edges of the Node.
      Returns:
      a collection containing the undirected ingoing and outgoing edges of the Node.
    • getUndirectedEdgesIterator

      Iterator<Edge> getUndirectedEdgesIterator()
      Returns an iterator containing all undirected edges of the Node.
      Returns:
      an iterator containing all undirected edges of the Node.
    • getUndirectedNeighbors

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

      Iterator<Node> getUndirectedNeighborsIterator()
    • setGraph

      void setGraph​(Graph graph)
      Parameters:
      graph -
    • getDegree

      int getDegree()
      Returns the degree of a node
      Returns:
      Returns the number of incoming directed edges + outgooing directed edges + number of connected undirected edges.