org.geotools.graph.structure
Interface DirectedNode

All Superinterfaces:
DirectedGraphable, Graphable, Node
All Known Implementing Classes:
BasicDirectedNode, BasicDirectedXYNode, OptDirectedNode, OptDirectedXYNode

public interface DirectedNode
extends Node, DirectedGraphable

Represents a node in a directed graph. A directed node differentiates between adjacent edges that start at the node and those adjacent edges that terminate at the node. The former are referred to as "in" edges, and the latter "out" edges.

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

Method Summary
 void addIn(DirectedEdge e)
          Adds an edge to the in adjacency list of the node.
 void addOut(DirectedEdge e)
          Adds an edge to the out adjacency list of the node.
 int getInDegree()
          Returns the in degree of the node.
 Edge getInEdge(DirectedNode other)
          Returns an edge that terminates at the node and originates from a specified node.
 java.util.List getInEdges()
          Returns the in adjacency list of the node.
 java.util.List getInEdges(DirectedNode other)
          Returns all edges that terminate at the node and originate from a specified node.
 int getOutDegree()
          Returns the out degree of the node.
 Edge getOutEdge(DirectedNode other)
          Returns an edge that originates at the node and terminates at a specified node.
 java.util.List getOutEdges()
          Returns the out adjacency list of the node.
 java.util.List getOutEdges(DirectedNode other)
          Returns all edges that originate at the node and terminate from at specified node.
 void removeIn(DirectedEdge e)
          Removes an edge from the in adjacency list of the node.
 void removeOut(DirectedEdge e)
          Removes an edge from the out adjacency list of node.
 
Methods inherited from interface org.geotools.graph.structure.Node
add, getDegree, getEdge, getEdges, getEdges, remove
 
Methods inherited from interface org.geotools.graph.structure.DirectedGraphable
getInRelated, getOutRelated
 
Methods inherited from interface org.geotools.graph.structure.Graphable
getCount, getID, getObject, getRelated, isVisited, setCount, setID, setObject, setVisited
 

Method Detail

addIn

void addIn(DirectedEdge e)
Adds an edge to the in adjacency list of the node.

Parameters:
e - A directed edge that terminates at the node.
See Also:
Node.add(Edge)

addOut

void addOut(DirectedEdge e)
Adds an edge to the out adjacency list of the node.

Parameters:
e - A directed edge that originates from the node.
See Also:
Node.add(Edge)

removeIn

void removeIn(DirectedEdge e)
Removes an edge from the in adjacency list of the node.

Parameters:
e - A directed edge that terminates at the node.
See Also:
Node.remove(Edge)

removeOut

void removeOut(DirectedEdge e)
Removes an edge from the out adjacency list of node.

Parameters:
e - A directed edge that originates from the node.
See Also:
Node.remove(Edge)

getInEdge

Edge getInEdge(DirectedNode other)
Returns an edge that terminates at the node and originates from a specified node.

Note: It is possible for two nodes to share multiple edges between them. In this case, getInEdges(Node other) can be used to obtain a complete list.

Parameters:
other - The originating node.
Returns:
The first edge found to terminate at the node and originate from the specefied node.
See Also:
Node.getEdge(Node)

getInEdges

java.util.List getInEdges(DirectedNode other)
Returns all edges that terminate at the node and originate from a specified node.

Parameters:
other - The originating node.
Returns:
All edges found to terminate at the node and originate from the specified node.
See Also:
Node.getEdges(Node)

getInEdges

java.util.List getInEdges()
Returns the in adjacency list of the node.

Returns:
A list of edges that terminate at the node.
See Also:
Node.getEdges()

getOutEdge

Edge getOutEdge(DirectedNode other)
Returns an edge that originates at the node and terminates at a specified node.

Note: It is possible for two nodes to share multiple edges between them. In this case, getOutEdges(Node other) can be used to obtain a complete list.

Parameters:
other - The terminating node.
Returns:
The first edge found to originate at the node and terminate at the specefied node.
See Also:
Node.getEdge(Node)

getOutEdges

java.util.List getOutEdges(DirectedNode other)
Returns all edges that originate at the node and terminate from at specified node.

Parameters:
other - The temimnating node.
Returns:
All edges found to originate at the node and terminate at the specified node.
See Also:
Node.getEdges(Node)

getOutEdges

java.util.List getOutEdges()
Returns the out adjacency list of the node.

Returns:
A list of edges originating at the node.
See Also:
Node.getEdges()

getInDegree

int getInDegree()
Returns the in degree of the node.

Returns:
The number of edges that terminate at the node.

getOutDegree

int getOutDegree()
Returns the out degree of the node.

Returns:
The number of edges that originate at the node.


Copyright © 1996-2010 Geotools. All Rights Reserved.