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.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isMarked |
protected boolean |
isVisited |
| 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
GraphComponents 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
GraphComponents in an Iterator |
public 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 static void setMarked(Iterator i, boolean marked)
GraphComponents in an Iteratori - the Iterator to scanmarked - the state to set the Marked flag topublic static void setVisited(Iterator i, boolean visited)
GraphComponents in an Iteratori - the Iterator to scanvisited - the state to set the visited flag topublic Object getContext()
public Object getData()
public boolean isMarked()
true if the component has been markedpublic abstract boolean isRemoved()
true if this component is removedpublic boolean isVisited()
true if the component has been visitedpublic void setContext(Object data)
data - an Object containing user-defined datapublic void setData(Object data)
data - an Object containing user-defined datapublic void setMarked(boolean isMarked)
isMarked - the desired value of the marked flagpublic void setVisited(boolean isVisited)
isVisited - the desired value of the visited flagCopyright © 2015 Revolution Systems Inc.. All rights reserved.