org.geotools.graph.structure
Interface DirectedNode

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

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.Graphable
getCount, getID, getObject, getRelated, isVisited, setCount, setID, setObject, setVisited
 
Methods inherited from interface org.geotools.graph.structure.DirectedGraphable
getInRelated, getOutRelated
 

Method Detail

addIn

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

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

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

getOutDegree

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

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


Copyright © GeoTools. All Rights Reserved.