Class AdjListNode

All Implemented Interfaces:
Comparable<GraphElement>, Attributable, GraphElement, Node
Direct Known Subclasses:
MergedNode

public class AdjListNode
extends AbstractNode
implements Node, GraphElement
Implements a graph node with adjacency list representation.
Version:
$Revision: 1.10 $
See Also:
AdjListGraph, AdjListEdge
  • Method Details

    • getDirectedInEdgesIterator

      public Iterator<Edge> getDirectedInEdgesIterator()
      Returns an iterator containing the directed ingoing edges of the Node.
      Specified by:
      getDirectedInEdgesIterator in interface Node
      Returns:
      an iterator containing the directed ingoing edges of the Node.
    • getDirectedOutEdgesIterator

      public Iterator<Edge> getDirectedOutEdgesIterator()
      Returns an iterator containing the outgoing directed edges of the Node.
      Specified by:
      getDirectedOutEdgesIterator in interface Node
      Returns:
      an iterator containing the outgoing directed edges of the Node.
    • getEdgesIterator

      public 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.
      Specified by:
      getEdgesIterator in interface Node
      Returns:
      an iterator 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
      Overrides:
      getInDegree in class AbstractNode
      Returns:
      the in-degree 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
      Overrides:
      getOutDegree in class AbstractNode
      Returns:
      the out-degree of the current Node.
    • getUndirectedEdgesIterator

      public Iterator<Edge> getUndirectedEdgesIterator()
      Returns an iterator containing the undirected ingoing and outgoing edges of the Node.
      Specified by:
      getUndirectedEdgesIterator in interface Node
      Returns:
      a iterator containing the undirected ingoing and outgoing edges of the Node.
    • getEdges

      public Collection<Edge> getEdges()
      Description copied from class: AbstractNode
      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
      Overrides:
      getEdges in class AbstractNode
      Returns:
      a collection containing all ingoing and outgoing directed and undirected edges of the current Node.
    • setGraph

      public void setGraph​(Graph graph)
      Specified by:
      setGraph in interface Node
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDegree

      public int getDegree()
      Description copied from interface: Node
      Returns the degree of a node
      Specified by:
      getDegree in interface Node
      Returns:
      Returns the number of incoming directed edges + outgooing directed edges + number of connected undirected edges.
    • compareTo

      public int compareTo​(GraphElement arg0)
      Specified by:
      compareTo in interface Comparable<GraphElement>