|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgrapht.experimental.dag.DirectedAcyclicGraph.VisitedArrayListImpl
public static class DirectedAcyclicGraph.VisitedArrayListImpl
This implementation seems to offer the best performance in most cases. It grows the internal ArrayList as needed to be as large as |AR|, so it will be more memory intensive than the HashSet implementation, and unlike the Array implementation, it will hold on to that memory (it expands, but never contracts).
Constructor Summary | |
---|---|
DirectedAcyclicGraph.VisitedArrayListImpl()
|
Method Summary | |
---|---|
void |
clearVisited(int index)
Clear the visited state of the given topological index |
DirectedAcyclicGraph.Visited |
getInstance(DirectedAcyclicGraph.Region affectedRegion)
|
boolean |
getVisited(int index)
has the given topological index been visited? |
void |
setVisited(int index)
mark the given topological index as visited |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DirectedAcyclicGraph.VisitedArrayListImpl()
Method Detail |
---|
public DirectedAcyclicGraph.Visited getInstance(DirectedAcyclicGraph.Region affectedRegion)
getInstance
in interface DirectedAcyclicGraph.VisitedFactory
public void setVisited(int index)
DirectedAcyclicGraph.Visited
setVisited
in interface DirectedAcyclicGraph.Visited
index
- the topological indexpublic boolean getVisited(int index)
DirectedAcyclicGraph.Visited
getVisited
in interface DirectedAcyclicGraph.Visited
index
- the topological indexpublic void clearVisited(int index) throws UnsupportedOperationException
DirectedAcyclicGraph.Visited
clearVisited
in interface DirectedAcyclicGraph.Visited
UnsupportedOperationException
- if the implementation doesn't
support (or doesn't need) clearance. For example, if the factory
vends a new instance every time, it is a waste of cycles to clear the
state after the search of the Affected Region is done, so an
UnsupportedOperationException *should* be thrown.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |