Package org.jgrapht.traverse
Interface GraphIterator<V,E>
- All Superinterfaces:
Iterator<V>
- All Known Implementing Classes:
AbstractGraphIterator
,BreadthFirstIterator
,ClosestFirstIterator
,CrossComponentIterator
,DepthFirstIterator
,TopologicalOrderIterator
A graph iterator.
- Since:
- Jul 31, 2003
- Author:
- Barak Naveh
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified traversal listener to this iterator.boolean
Test whether this iterator is set to traverse the grpah across connected components.boolean
Tests whether thereuseEvents
flag is set.void
remove()
Unsupported.void
Removes the specified traversal listener from this iterator.void
setReuseEvents
(boolean reuseEvents) Sets a value thereuseEvents
flag.Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next
-
Method Details
-
isCrossComponentTraversal
boolean isCrossComponentTraversal()Test whether this iterator is set to traverse the grpah across connected components.- Returns:
true
if traverses across connected components, otherwisefalse
.
-
setReuseEvents
void setReuseEvents(boolean reuseEvents) Sets a value thereuseEvents
flag. If thereuseEvents
flag is set totrue
this class will reuse previously fired events and will not create a new object for each event. This option increases performance but should be used with care, especially in multithreaded environment.- Parameters:
reuseEvents
- whether to reuse previously fired event objects instead of creating a new event object for each event.
-
isReuseEvents
boolean isReuseEvents()Tests whether thereuseEvents
flag is set. If the flag is set totrue
this class will reuse previously fired events and will not create a new object for each event. This option increases performance but should be used with care, especially in multithreaded environment.- Returns:
- the value of the
reuseEvents
flag.
-
addTraversalListener
Adds the specified traversal listener to this iterator.- Parameters:
l
- the traversal listener to be added.
-
remove
void remove()Unsupported.- Specified by:
remove
in interfaceIterator<V>
- Throws:
UnsupportedOperationException
-
removeTraversalListener
Removes the specified traversal listener from this iterator.- Parameters:
l
- the traversal listener to be removed.
-