|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hypergraphdb.algorithms.HGDepthFirstTraversal
public class HGDepthFirstTraversal
Implements a depth-first search of a graph. As a reminder, depth-first will visit atoms adjacent to the current before visiting its siblings.
| Constructor Summary | |
|---|---|
HGDepthFirstTraversal(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 HGDepthFirstTraversal(HGHandle startAtom,
HGALGenerator adjListGenerator)
| Method Detail |
|---|
public HGHandle getStartAtom()
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 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 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 void remove()
remove in interface java.util.Iterator<Pair<HGHandle,HGHandle>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||