public abstract class GraphComponent extends Object
Graph components support storing user context data. This will typically be used by client algorithms which use planar graphs.
Constructor and Description |
---|
GraphComponent() |
Modifier and Type | Method and Description |
---|---|
static GraphComponent |
getComponentWithVisitedState(Iterator i,
boolean visitedState)
Finds the first
GraphComponent in a Iterator set
which has the specified visited state. |
Object |
getContext()
Gets the user-defined data for this component.
|
Object |
getData()
Gets the user-defined data for this component.
|
boolean |
isMarked()
Tests if a component has been marked at some point during the processing
involving this graph.
|
abstract boolean |
isRemoved()
Tests whether this component has been removed from its containing graph
|
boolean |
isVisited()
Tests if a component has been visited during the course of a graph algorithm
|
void |
setContext(Object data)
Sets the user-defined data for this component.
|
void |
setData(Object data)
Sets the user-defined data for this component.
|
void |
setMarked(boolean isMarked)
Sets the marked flag for this component.
|
static void |
setMarked(Iterator i,
boolean marked)
Sets the Marked state for all
GraphComponent s in an Iterator |
void |
setVisited(boolean isVisited)
Sets the visited flag for this component.
|
static void |
setVisited(Iterator i,
boolean visited)
Sets the Visited state for all
GraphComponent s in an Iterator |
public static void setVisited(Iterator i, boolean visited)
GraphComponent
s in an Iterator
i
- the Iterator to scanvisited
- the state to set the visited flag topublic static void setMarked(Iterator i, boolean marked)
GraphComponent
s in an Iterator
i
- the Iterator to scanmarked
- the state to set the Marked flag topublic static GraphComponent getComponentWithVisitedState(Iterator i, boolean visitedState)
GraphComponent
in a Iterator
set
which has the specified visited state.i
- an Iterator of GraphComponentsvisitedState
- the visited state to testnull
if none foundpublic boolean isVisited()
true
if the component has been visitedpublic void setVisited(boolean isVisited)
isVisited
- the desired value of the visited flagpublic boolean isMarked()
true
if the component has been markedpublic void setMarked(boolean isMarked)
isMarked
- the desired value of the marked flagpublic void setContext(Object data)
data
- an Object containing user-defined datapublic Object getContext()
public void setData(Object data)
data
- an Object containing user-defined datapublic Object getData()
public abstract boolean isRemoved()
true
if this component is removedCopyright © 2022. All rights reserved.