|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprefuse.data.util.BreadthFirstIterator
public class BreadthFirstIterator
Provides a distance-limited breadth first traversal over nodes, edges, or both, using any number of traversal "roots".
| Field Summary | |
|---|---|
protected int |
m_depth
|
protected boolean |
m_includeEdges
|
protected boolean |
m_includeNodes
|
protected Queue |
m_queue
|
protected int |
m_traversal
|
| Constructor Summary | |
|---|---|
BreadthFirstIterator()
Create an uninitialized BreadthFirstIterator. |
|
BreadthFirstIterator(java.util.Iterator it,
int depth,
int traversal)
Create a new BreadthFirstIterator starting from the given source nodes. |
|
BreadthFirstIterator(Node n,
int depth,
int traversal)
Create a new BreadthFirstIterator starting from the given source node. |
|
| Method Summary | |
|---|---|
int |
getDepth(Tuple t)
Get the traversal depth at which a particular tuple was encountered. |
protected java.util.Iterator |
getEdges(Node n)
Determines which edges are traversed for a given node. |
boolean |
hasNext()
|
void |
init(java.lang.Object o,
int depth,
int traversal)
Initialize (or re-initialize) this iterator. |
java.lang.Object |
next()
|
void |
remove()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Queue m_queue
protected int m_depth
protected int m_traversal
protected boolean m_includeNodes
protected boolean m_includeEdges
| Constructor Detail |
|---|
public BreadthFirstIterator()
init(Object, int, int) method to initialize the iterator.
public BreadthFirstIterator(Node n,
int depth,
int traversal)
n - the source node from which to begin the traversaldepth - the maximum graph distance to traversetraversal - the traversal type, one of
Constants.NODE_TRAVERSAL,
Constants.EDGE_TRAVERSAL, or
Constants.NODE_AND_EDGE_TRAVERSAL
public BreadthFirstIterator(java.util.Iterator it,
int depth,
int traversal)
it - an Iterator over the source nodes from which to begin the
traversaldepth - the maximum graph distance to traversetraversal - the traversal type, one of
Constants.NODE_TRAVERSAL,
Constants.EDGE_TRAVERSAL, or
Constants.NODE_AND_EDGE_TRAVERSAL| Method Detail |
|---|
public void init(java.lang.Object o,
int depth,
int traversal)
o - Either a source node or iterator over source nodesdepth - the maximum graph distance to traversetraversal - the traversal type, one of
Constants.NODE_TRAVERSAL,
Constants.EDGE_TRAVERSAL, or
Constants.NODE_AND_EDGE_TRAVERSALpublic void remove()
remove in interface java.util.IteratorIterator.remove()public boolean hasNext()
hasNext in interface java.util.IteratorIterator.hasNext()protected java.util.Iterator getEdges(Node n)
n - a node
public int getDepth(Tuple t)
t - the tuple to lookup
public java.lang.Object next()
next in interface java.util.IteratorIterator.next()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||