|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.graph.structure.basic.BasicGraph
Basic implemenation of Graph.
Graph
,
Serialized FormField Summary |
Fields inherited from interface org.geotools.graph.structure.Graph |
FAIL_QUERY, PASS_AND_CONTINUE, PASS_AND_STOP |
Constructor Summary | |
BasicGraph()
Constructs an empty graph with edge and node collections uninitialized. |
|
BasicGraph(java.util.Collection nodes,
java.util.Collection edges)
Constructs a graph from a collection of nodes and a collection of edges. |
Method Summary | |
java.util.Collection |
getEdges()
Returns the edges of the graph. |
java.util.Collection |
getNodes()
Returns the nodes of the graph. |
java.util.List |
getNodesOfDegree(int n)
Returns all the nodes in the graph of a specified degree. |
java.util.List |
getVisitedEdges(boolean visited)
Returns all the edges in the graph that have been marked as visited or non-visited. |
java.util.List |
getVisitedNodes(boolean visited)
Returns all the nodes in the graph that have been marked as visited or non-visited. |
void |
initEdges()
Initializes the edges in the graph by setting all visited flags to false and all visited counts to zero. |
void |
initNodes()
Initializes the nodes in the graph by setting all visited flags to false and all visited counts to zero. |
java.util.List |
queryEdges(GraphVisitor visitor)
Performs a query against the edges of the graph. |
java.util.List |
queryNodes(GraphVisitor visitor)
Performs a query against the nodes of the graph. |
void |
setEdges(java.util.Collection edges)
Sets the edge collection for the graph. |
void |
setNodes(java.util.Collection nodes)
Sets the node collection of the graph. |
java.lang.String |
toString()
Returns the string representation of the graph which is just the string representation of the edge and node collections. |
void |
visitEdges(GraphVisitor visitor)
Applies the visitor pattern to the edges of the graph. |
void |
visitNodes(GraphVisitor visitor)
Applies the visitor pattern to the nodes of the graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BasicGraph()
public BasicGraph(java.util.Collection nodes, java.util.Collection edges)
nodes
- Collection of nodes to be contained by the graph.edges
- Collection of edges to be contained by the graph.Method Detail |
public void setNodes(java.util.Collection nodes)
nodes
- Collection of Node objects.public java.util.Collection getNodes()
Graph
getNodes
in interface Graph
Graph.getNodes()
public void setEdges(java.util.Collection edges)
edges
- Collection of Edge objects.public java.util.Collection getEdges()
Graph
getEdges
in interface Graph
Graph.getEdges()
public java.util.List queryNodes(GraphVisitor visitor)
Graph
queryNodes
in interface Graph
visitor
- Determines if node meets query criteria.
Returns MEET_AND_CONTINUE to signal that the node meets the query criteria
and the query should continue.Graph.queryNodes(GraphVisitor)
public java.util.List queryEdges(GraphVisitor visitor)
Graph
queryEdges
in interface Graph
visitor
- Determines if the meets the query criteria. Graph.queryEdges(GraphVisitor)
public void visitNodes(GraphVisitor visitor)
Graph
visitNodes
in interface Graph
visitor
- Graph.visitNodes(GraphVisitor)
public void visitEdges(GraphVisitor visitor)
Graph
visitEdges
in interface Graph
visitor
- Graph.visitEdges(GraphVisitor)
public java.util.List getNodesOfDegree(int n)
Graph
getNodesOfDegree
in interface Graph
n
- The desired degree of nodes to be returned.
Graph.getNodesOfDegree(int)
,
Node.getDegree()
public java.util.List getVisitedNodes(boolean visited)
Graph
getVisitedNodes
in interface Graph
visited
- True if node is visited, false if node is unvisited.
Graph.getVisitedNodes(boolean)
public java.util.List getVisitedEdges(boolean visited)
Graph
getVisitedEdges
in interface Graph
visited
- True if edge is visited, false if edge is unvisited.
Graph.getVisitedEdges(boolean)
public void initNodes()
BasicGraphable.isVisited()
,
BasicGraphable.getCount()
public void initEdges()
BasicGraphable.isVisited()
,
BasicGraphable.getCount()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |