Class DirectedGraph.DataNode<D>

Enclosing class:

public static final class DirectedGraph.DataNode<D> extends Object
The representation of a node in a graph.
  • Constructor Details

    • DataNode

      public DataNode(D obj)
  • Method Details

    • getData

      public D getData()
      Gets the data that this node represents.
    • addEdge

      public void addEdge(DirectedGraph.DataNode<D> other)
      Adds an edge from this node to the given node.
    • removeEdge

      public boolean removeEdge(DirectedGraph.DataNode<D> other)
      Deletes the node from this node to the given node if it exists.
    • isAdjacent

      public boolean isAdjacent(DirectedGraph.DataNode<D> other)
      Returns if this node has an edge to the given node.
    • getEdgeCount

      public int getEdgeCount()
      Gets the count of edges originating from this node.
    • getAdjacent

      public Collection<DirectedGraph.DataNode<D>> getAdjacent()
      Gets all nodes for which there is an edge from this node.
    • hashCode

      public int hashCode()
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      equals in class Object