Package org.geotools.graph.structure
Interface Node
- All Superinterfaces:
Graphable
- All Known Subinterfaces:
DirectedNode
,XYNode
- All Known Implementing Classes:
BasicDirectedNode
,BasicDirectedXYNode
,BasicNode
,BasicXYNode
,DelaunayNode
,OptDirectedNode
,OptDirectedXYNode
,OptNode
,OptXYNode
Represents a node in a graph. A node is a point in a graph which is iadjacent to 0 or more edges. The collection of
edges that are incident/ adjacent to the node, is referred to as the "adjacency list" of the node.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an edge to the adjacency list of the node.int
Returns the degree of the node.Returns an edge in the adjacency list of the node that is adjacent to another specified node.getEdges()
Returns the edge adjacency list of the node.Returns a collection of edges in the adjacency list of the node that are adjacent to another specified node.void
Removes an edge from the adjacency list of the node.Methods inherited from interface Graphable
getCount, getID, getObject, getRelated, isVisited, setCount, setID, setObject, setVisited
-
Method Details
-
add
Adds an edge to the adjacency list of the node.- Parameters:
e
- Adjacent edge to add.
-
remove
Removes an edge from the adjacency list of the node.- Parameters:
e
- Adjacent edge to remove.
-
getEdge
Returns an edge in the adjacency list of the node that is adjacent to another specified node.
Note: It is possible for two nodes to share multiple edges between them. In this case, getEdges(Node other) can be used to obtain a complete list.- Parameters:
other
- The other node that the desired edge to return is adjacent to.- Returns:
- The first edge that is found to be adjacent to the specified node.
-
getEdges
Returns a collection of edges in the adjacency list of the node that are adjacent to another specified node.- Parameters:
other
- The other node that the desired edges to return are adjacent to.- Returns:
- List of all edges that are found to be adjacent to the specified node.
-
getEdges
Returns the edge adjacency list of the node.- Returns:
- A list containing all edges that are adjacent to the node.
-
getDegree
int getDegree()Returns the degree of the node. The degree of a node is defined as the number of edges that are adjacent to the node.- Returns:
- int Degree of node.
-