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
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
Sets the user-defined data for this component.
|
void |
setData(Object
Sets the user-defined data for this component.
|
void |
setMarked(boolean isMarked)
Sets the marked flag for this component.
|
static void |
setMarked(Iterator
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
Sets the Visited state for all
GraphComponents in an
Iterator
|
public static void setVisited(Iteratori, boolean visited)
GraphComponents in an
Iterator
i - the Iterator to scan
visited - the state to set the visited flag to
public static void setMarked(Iteratori, boolean marked)
GraphComponents in an
Iterator
i - the Iterator to scan
marked - the state to set the Marked flag to
public static GraphComponentgetComponentWithVisitedState(Iterator i, boolean visitedState)
GraphComponent in a
Iterator set which has the specified visited state.
i - an Iterator of GraphComponents
visitedState - the visited state to test
null if none found
public boolean isVisited()
true if the component has been visited
public void setVisited(boolean isVisited)
isVisited - the desired value of the visited flag
public boolean isMarked()
true if the component has been marked
public void setMarked(boolean isMarked)
isMarked - the desired value of the marked flag
public void setContext(Objectdata)
data - an Object containing user-defined data
public ObjectgetContext()
public void setData(Objectdata)
data - an Object containing user-defined data
public ObjectgetData()
public abstract boolean isRemoved()
true if this component is removed