public class CopyGraphTraversal extends Object implements HGTraversal
A breadth-first like traversal that will return the same atom multiple times - once for each distinct link leading to it.
Constructor and Description |
---|
CopyGraphTraversal() |
CopyGraphTraversal(HGHandle startAtom,
HGALGenerator adjListGenerator) |
CopyGraphTraversal(HGHandle startAtom,
HGALGenerator adjListGenerator,
int maxDistance) |
Modifier and Type | Method and Description |
---|---|
HGALGenerator |
getAdjListGenerator() |
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() |
void |
reset() |
void |
setAdjListGenerator(HGALGenerator adjListGenerator) |
void |
setStartAtom(HGHandle startAtom) |
public CopyGraphTraversal()
public CopyGraphTraversal(HGHandle startAtom, HGALGenerator adjListGenerator)
public CopyGraphTraversal(HGHandle startAtom, HGALGenerator adjListGenerator, int maxDistance)
public void setStartAtom(HGHandle startAtom)
public HGHandle getStartAtom()
public HGALGenerator getAdjListGenerator()
public void setAdjListGenerator(HGALGenerator adjListGenerator)
public boolean hasNext()
HGTraversal
Return true
if there are remaining atoms to be visited and
false
otherwise.
public boolean isVisited(HGHandle handle)
HGTraversal
Return 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 HGTraversal
handle
- The handle of the atom.public Pair<HGHandle,HGHandle> next()
HGTraversal
Return 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>.
public void reset()
Copyright © 2015. All rights reserved.