|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hypergraphdb.algorithms.HGBreadthFirstTraversal
public class HGBreadthFirstTraversal
Implements a depth-first search of a graph. As a reminder, breadth-first will visit all atoms in an adjency list before exploring their adjacent atoms in turn.
| Constructor Summary | |
|---|---|
HGBreadthFirstTraversal(HGHandle startAtom,
HGALGenerator adjListGenerator)
|
|
| Method Summary | |
|---|---|
HGHandle |
getStartAtom()
|
boolean |
hasNext()
Return true if there are remaining atoms to be visited and
false otherwise. |
boolean |
isVisited(HGHandle handle)
Return true if the given atom was already visited and
false otherwise. |
Pair<HGHandle,HGHandle> |
next()
Return a pair consisting of the link pointing to the next atom in the traversal as well as the atom itself. |
void |
remove()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HGBreadthFirstTraversal(HGHandle startAtom,
HGALGenerator adjListGenerator)
| Method Detail |
|---|
public HGHandle getStartAtom()
public void remove()
remove in interface java.util.Iterator<Pair<HGHandle,HGHandle>>public boolean hasNext()
HGTraversalReturn true if there are remaining atoms to be visited and
false otherwise.
hasNext in interface java.util.Iterator<Pair<HGHandle,HGHandle>>hasNext in interface HGTraversalpublic boolean isVisited(HGHandle handle)
HGTraversalReturn true if the given atom was already visited and
false otherwise.
An atom is considered visited as soon as it is returned by a call to the
next method, and not before.
isVisited in interface HGTraversalhandle - The handle of the atom.public Pair<HGHandle,HGHandle> next()
HGTraversalReturn a pair consisting of the link pointing to the next atom in the traversal as well as the atom itself. That is, return a Pair<handle to link, handle to target atom>.
next in interface java.util.Iterator<Pair<HGHandle,HGHandle>>next in interface HGTraversal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||