org.geotools.graph.structure
Interface Node

All Superinterfaces:
Graphable
All Known Subinterfaces:
DirectedNode, XYNode
All Known Implementing Classes:
BasicDirectedNode, BasicDirectedXYNode, BasicNode, BasicXYNode, OptDirectedNode, OptDirectedXYNode, OptNode, OptXYNode

public interface Node
extends Graphable

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.

Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
See Also:
Graph, Edge

Method Summary
 void add(Edge e)
          Adds an edge to the adjacency list of the node.
 int getDegree()
          Returns the degree of the node.
 Edge getEdge(Node other)
          Returns an edge in the adjacency list of the node that is adjacent to another specified node.
 java.util.List getEdges()
          Returns the edge adjacency list of the node.
 java.util.List getEdges(Node other)
          Returns a collection of edges in the adjacency list of the node that are adjacent to another specified node.
 void remove(Edge e)
          Removes an edge from the adjacency list of the node.
 
Methods inherited from interface org.geotools.graph.structure.Graphable
getCount, getID, getObject, getRelated, isVisited, setCount, setID, setObject, setVisited
 

Method Detail

add

public void add(Edge e)
Adds an edge to the adjacency list of the node.

Parameters:
e - Adjacent edge to add.

remove

public void remove(Edge e)
Removes an edge from the adjacency list of the node.

Parameters:
e - Adjacent edge to remove.

getEdge

public Edge getEdge(Node other)
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

public java.util.List getEdges(Node other)
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

public java.util.List getEdges()
Returns the edge adjacency list of the node.

Returns:
A list containing all edges that are adjacent to the node.

getDegree

public 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.


Copyright © GeoTools. All Rights Reserved.