public class HyperTraversal extends Object implements HGTraversal, HGGraphHolder
This class is work in progress - it was done to solve the immediate problem of transferring a sub-graph from one location to another. But a fully general and clean notion of a "hyper-traversal" is yet to be defined....logged as an issue on the project pages.
| Constructor and Description |
|---|
HyperTraversal() |
HyperTraversal(HyperGraph graph,
HGTraversal flatTraversal) |
HyperTraversal(HyperGraph graph,
HGTraversal flatTraversal,
HGAtomPredicate linkPredicate) |
| Modifier and Type | Method and Description |
|---|---|
HGTraversal |
getFlatTraversal() |
HyperGraph |
getHyperGraph() |
HGAtomPredicate |
getLinkPredicate() |
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 |
setFlatTraversal(HGTraversal flatTraversal) |
void |
setHyperGraph(HyperGraph graph)
During load time, set the
HyperGraph
instance to which this atom belongs. |
void |
setLinkPredicate(HGAtomPredicate linkPredicate) |
public HyperTraversal()
public HyperTraversal(HyperGraph graph, HGTraversal flatTraversal)
public HyperTraversal(HyperGraph graph, HGTraversal flatTraversal, HGAtomPredicate linkPredicate)
public boolean hasNext()
HGTraversalReturn true if there are remaining atoms to be visited and
false otherwise.
public 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>.
public HGTraversal getFlatTraversal()
public void setFlatTraversal(HGTraversal flatTraversal)
public HGAtomPredicate getLinkPredicate()
public void setLinkPredicate(HGAtomPredicate linkPredicate)
public void setHyperGraph(HyperGraph graph)
HGGraphHolderDuring load time, set the HyperGraph
instance to which this atom belongs.
setHyperGraph in interface HGGraphHolderpublic HyperGraph getHyperGraph()
Copyright © 2015. All rights reserved.