Class DirectedGraph.DataNode<D>
java.lang.Object
org.spongepowered.collections.graph.DirectedGraph.DataNode<D>
- Enclosing class:
- DirectedGraph<D>
The representation of a node in a graph.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEdge
(DirectedGraph.DataNode<D> other) Adds an edge from this node to the given node.boolean
Gets all nodes for which there is an edge from this node.getData()
Gets the data that this node represents.int
Gets the count of edges originating from this node.int
hashCode()
boolean
isAdjacent
(DirectedGraph.DataNode<D> other) Returns if this node has an edge to the given node.boolean
removeEdge
(DirectedGraph.DataNode<D> other) Deletes the node from this node to the given node if it exists.
-
Constructor Details
-
DataNode
-
-
Method Details
-
getData
Gets the data that this node represents. -
addEdge
Adds an edge from this node to the given node. -
removeEdge
Deletes the node from this node to the given node if it exists. -
isAdjacent
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
Gets all nodes for which there is an edge from this node. -
hashCode
public int hashCode() -
equals
-