com.vividsolutions.jts.planargraph
Class GraphComponent
java.lang.Object
com.vividsolutions.jts.planargraph.GraphComponent
public class GraphComponent
extends java.lang.Object
The base class for all graph component classes.
Maintains flags of use in generic graph algorithms.
Provides two flags:
- marked - typically this is used to indicate a state that persists
for the course of the graph's lifetime. For instance, it can be
used to indicate that a component has been logically deleted from the graph.
- visited - this is used to indicate that a component has been processed
or visited by an single graph algorithm. For instance, a breadth-first traversal of the
graph might use this to indicate that a node has already been traversed.
The visited flag may be set and cleared many times during the lifetime of a graph.
boolean | isMarked() - Tests if a component has been marked at some point during the processing
involving this graph.
|
boolean | isVisited() - Tests if a component has been visited during the course of a graph algorithm
|
void | setMarked(boolean isMarked) - Sets the marked flag for this component.
|
void | setVisited(boolean isVisited) - Sets the visited flag for this component.
|
isMarked
protected boolean isMarked
isVisited
protected boolean isVisited
GraphComponent
public GraphComponent()
isMarked
public boolean isMarked()
Tests if a component has been marked at some point during the processing
involving this graph.
true
if the component has been marked
isVisited
public boolean isVisited()
Tests if a component has been visited during the course of a graph algorithm
true
if the component has been visited
setMarked
public void setMarked(boolean isMarked)
Sets the marked flag for this component.
isMarked
- the desired value of the marked flag
setVisited
public void setVisited(boolean isVisited)
Sets the visited flag for this component.
isVisited
- the desired value of the visited flag