org.geotools.graph
Class InOutNode

java.lang.Object
  extended byorg.geotools.graph.GraphComponent
      extended byorg.geotools.graph.Node
          extended byorg.geotools.graph.PointNode
              extended byorg.geotools.graph.InOutNode
All Implemented Interfaces:
org.geotools.feature.Feature

public class InOutNode
extends PointNode

A Node which sperates adjacent edges into two categories. Those in which the node is the terminal node of the edge (in edges), and those in which the node is the source node of the edge (out edges).


Nested Class Summary
 
Nested classes inherited from class org.geotools.feature.Feature
org.geotools.feature.Feature.NULL
 
Constructor Summary
InOutNode(org.geotools.feature.Feature feature, EdgeList edgeList, com.vividsolutions.jts.geom.Coordinate coord)
          InOutNode constructor.
 
Method Summary
 java.util.Collection getAdjacentElements()
          Returns the terminal nodes of all edges adjacent to the node.
 int getInDegree()
          Returns the in degree of the node.
 Edge getInEdge(Node source)
          Returns an edge in which the node is the terminal node, and the source node is specified.
 java.util.List getInEdges()
          Returns a list of edges in which the node is the terminal node.
 java.util.List getInNodes()
          Returns a list of nodes in which the node is the terminal node.
 int getOutDegree()
          Returns the out degree of the node.
 Edge getOutEdge(Node terminal)
          Returns an edge in which the node is the source node, and the terminal node is specified.
 java.util.List getOutEdges()
          Returns a list of edges in which the node is the source node.
 java.util.List getOutNodes()
          Returns a list of nodes in which the node is the source node of the edge shared between them.
 
Methods inherited from class org.geotools.graph.PointNode
asCoordinate, buildGeometry, x, y
 
Methods inherited from class org.geotools.graph.Node
addEdge, getDegree, getEdge, getEdgeList, getOtherEdges, removeEdge, toString
 
Methods inherited from class org.geotools.graph.GraphComponent
compareTo, getAttribute, getAttribute, getAttributes, getBounds, getCount, getDefaultGeometry, getFeature, getFeatureType, getID, getNumberOfAttributes, getParent, getSchema, isVisited, schema, setAttribute, setAttribute, setAttributes, setCount, setDefaultGeometry, setParent, setVisited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InOutNode

public InOutNode(org.geotools.feature.Feature feature,
                 EdgeList edgeList,
                 com.vividsolutions.jts.geom.Coordinate coord)
InOutNode constructor.

super(feature,edgeList,coord);

Parameters:
feature - Feature
edgeList - InOutEdgeList
coord - Coordinate
Method Detail

getInNodes

public java.util.List getInNodes()
Returns a list of nodes in which the node is the terminal node. In other words, it returns all the source nodes of all edges adjacent to the node.

Returns:
List

getInEdges

public java.util.List getInEdges()
Returns a list of edges in which the node is the terminal node.

Returns:
List

getInEdge

public Edge getInEdge(Node source)
Returns an edge in which the node is the terminal node, and the source node is specified.

Parameters:
source - The source node of the edge to be returned.
Returns:
The edge (source,this).

getOutNodes

public java.util.List getOutNodes()
Returns a list of nodes in which the node is the source node of the edge shared between them. In other words, it returns all the terminal nodes of all edges adjacent to the node.

Returns:
List

getOutEdges

public java.util.List getOutEdges()
Returns a list of edges in which the node is the source node.

Returns:
List

getOutEdge

public Edge getOutEdge(Node terminal)
Returns an edge in which the node is the source node, and the terminal node is specified.

Parameters:
terminal - The terminal node of the edge to be returned.
Returns:
The edge (this,terminal).

getInDegree

public int getInDegree()
Returns the in degree of the node. The number of edges adjacent to the node in which the node is the terminal node of the edge.

Returns:
int

getOutDegree

public int getOutDegree()
Returns the out degree of the node. The number of edges adjacent to the node in which the node is the source node of the edge.

Returns:
int

getAdjacentElements

public java.util.Collection getAdjacentElements()
Returns the terminal nodes of all edges adjacent to the node.

Overrides:
getAdjacentElements in class Node
Returns:
Collection
See Also:
GraphComponent.getAdjacentElements()