public abstract class AbstractGraphIterator<V,E> extends Object implements GraphIterator<V,E>
Modifier and Type | Field and Description |
---|---|
protected int |
nListeners |
Constructor and Description |
---|
AbstractGraphIterator() |
Modifier and Type | Method and Description |
---|---|
void |
addTraversalListener(TraversalListener<V,E> l)
Adds the specified traversal listener to this iterator.
|
protected void |
fireConnectedComponentFinished(ConnectedComponentTraversalEvent e)
Informs all listeners that the traversal of the current connected
component finished.
|
protected void |
fireConnectedComponentStarted(ConnectedComponentTraversalEvent e)
Informs all listeners that a traversal of a new connected component has
started.
|
protected void |
fireEdgeTraversed(EdgeTraversalEvent<V,E> e)
Informs all listeners that a the specified edge was visited.
|
protected void |
fireVertexFinished(VertexTraversalEvent<V> e)
Informs all listeners that a the specified vertex was finished.
|
protected void |
fireVertexTraversed(VertexTraversalEvent<V> e)
Informs all listeners that a the specified vertex was visited.
|
boolean |
isCrossComponentTraversal()
Test whether this iterator is set to traverse the graph across connected
components.
|
boolean |
isReuseEvents()
Tests whether the
reuseEvents flag is set. |
void |
remove()
Unsupported.
|
void |
removeTraversalListener(TraversalListener<V,E> l)
Removes the specified traversal listener from this iterator.
|
void |
setCrossComponentTraversal(boolean crossComponentTraversal)
Sets the cross component traversal flag - indicates whether to traverse
the graph across connected components.
|
void |
setReuseEvents(boolean reuseEvents)
Sets a value the
reuseEvents flag. |
public void setCrossComponentTraversal(boolean crossComponentTraversal)
crossComponentTraversal
- if true
traverses across
connected components.public boolean isCrossComponentTraversal()
isCrossComponentTraversal
in interface GraphIterator<V,E>
true
if traverses across connected components,
otherwise false
.public void setReuseEvents(boolean reuseEvents)
GraphIterator
reuseEvents
flag. If the
reuseEvents
flag is set to true
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.setReuseEvents
in interface GraphIterator<V,E>
reuseEvents
- whether to reuse previously fired event objects
instead of creating a new event object for each event.GraphIterator.setReuseEvents(boolean)
public boolean isReuseEvents()
GraphIterator
reuseEvents
flag is set. If the flag is
set to true
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.isReuseEvents
in interface GraphIterator<V,E>
reuseEvents
flag.GraphIterator.isReuseEvents()
public void addTraversalListener(TraversalListener<V,E> l)
addTraversalListener
in interface GraphIterator<V,E>
l
- the traversal listener to be added.public void remove()
remove
in interface Iterator<V>
remove
in interface GraphIterator<V,E>
UnsupportedOperationException
public void removeTraversalListener(TraversalListener<V,E> l)
removeTraversalListener
in interface GraphIterator<V,E>
l
- the traversal listener to be removed.protected void fireConnectedComponentFinished(ConnectedComponentTraversalEvent e)
e
- the connected component finished event.protected void fireConnectedComponentStarted(ConnectedComponentTraversalEvent e)
e
- the connected component started event.protected void fireEdgeTraversed(EdgeTraversalEvent<V,E> e)
e
- the edge traversal event.protected void fireVertexTraversed(VertexTraversalEvent<V> e)
e
- the vertex traversal event.protected void fireVertexFinished(VertexTraversalEvent<V> e)
e
- the vertex traversal event.Copyright © 2016. All rights reserved.