use of com.baidu.hugegraph.traversal.algorithm.HugeTraverser.PathSet in project incubator-hugegraph by apache.
the class PathsRecords method findPath.
@Watched
@Override
public PathSet findPath(Id target, Function<Id, Boolean> filter, boolean all, boolean ring) {
assert all;
int targetCode = this.code(target);
int parentCode = this.current();
PathSet paths = PathSet.EMPTY;
// Traverse backtrace is not allowed, stop now
if (this.parentsContain(targetCode)) {
return paths;
}
// Add to current layer
this.addPath(targetCode, parentCode);
// If cross point exists, path found, concat them
if (this.movingForward() && this.targetContains(targetCode)) {
paths = this.linkPath(parentCode, targetCode, ring);
}
if (!this.movingForward() && this.sourceContains(targetCode)) {
paths = this.linkPath(targetCode, parentCode, ring);
}
return paths;
}
Aggregations