public class BasicGraph extends Object implements Graph, Serializable
Graph
,
Serialized FormFAIL_QUERY, PASS_AND_CONTINUE, PASS_AND_STOP
Constructor and Description 

BasicGraph()
Constructs an empty graph with edge and node collections uninitialized.

BasicGraph(Collection nodes,
Collection edges)
Constructs a graph from a collection of nodes and a collection of edges.

Modifier and Type  Method and Description 

Collection 
getEdges()
Returns the edges of the graph.

Collection 
getNodes()
Returns the nodes of the graph.

List 
getNodesOfDegree(int n)
Returns all the nodes in the graph of a specified degree.

List 
getVisitedEdges(boolean visited)
Returns all the edges in the graph that have been marked as visited or nonvisited.

List 
getVisitedNodes(boolean visited)
Returns all the nodes in the graph that have been marked as visited or nonvisited.

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.

List 
queryEdges(GraphVisitor visitor)
Performs a query against the edges of the graph.

List 
queryNodes(GraphVisitor visitor)
Performs a query against the nodes of the graph.

void 
setEdges(Collection edges)
Sets the edge collection for the graph.

void 
setNodes(Collection nodes)
Sets the node collection of the graph.

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.

public BasicGraph()
public BasicGraph(Collection nodes, Collection edges)
nodes
 Collection of nodes to be contained by the graph.edges
 Collection of edges to be contained by the graph.public void setNodes(Collection nodes)
nodes
 Collection of Node objects.public Collection getNodes()
Graph
getNodes
in interface Graph
Graph.getNodes()
public void setEdges(Collection edges)
edges
 Collection of Edge objects.public Collection getEdges()
Graph
getEdges
in interface Graph
Graph.getEdges()
public 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 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
Graph.visitNodes(GraphVisitor)
public void visitEdges(GraphVisitor visitor)
Graph
visitEdges
in interface Graph
Graph.visitEdges(GraphVisitor)
public List getNodesOfDegree(int n)
Graph
getNodesOfDegree
in interface Graph
n
 The desired degree of nodes to be returned.Graph.getNodesOfDegree(int)
,
Node.getDegree()
public List getVisitedNodes(boolean visited)
Graph
getVisitedNodes
in interface Graph
visited
 True if node is visited, false if node is unvisited.Graph.getVisitedNodes(boolean)
public 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()
public void initEdges()
Copyright © 1996–2018 Geotools. All rights reserved.