Class DirectedGraph.DataNode<D>

java.lang.Object
org.spongepowered.collections.graph.DirectedGraph.DataNode<D>
Enclosing class:
DirectedGraph<D>

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()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object