本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.Path.forEach方法的典型用法代码示例。如果您正苦于以下问题:Java Path.forEach方法的具体用法?Java Path.forEach怎么用?Java Path.forEach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.process.traversal.Path
的用法示例。
在下文中一共展示了Path.forEach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DetachedPath
import org.apache.tinkerpop.gremlin.process.traversal.Path; //导入方法依赖的package包/类
protected DetachedPath(final Path path, final boolean withProperties) {
path.forEach((object, labels) -> {
if (object instanceof DetachedElement || object instanceof DetachedProperty || object instanceof DetachedPath) {
this.objects.add(object);
this.labels.add(labels);
} else if (object instanceof Element) {
this.objects.add(DetachedFactory.detach((Element) object, withProperties));
this.labels.add(labels);
} else if (object instanceof Property) {
this.objects.add(DetachedFactory.detach((Property) object));
this.labels.add(labels);
} else if (object instanceof Path) {
this.objects.add(DetachedFactory.detach((Path) object, withProperties));
this.labels.add(labels);
} else {
this.objects.add(object);
this.labels.add(labels);
}
});
}
示例2: ReferencePath
import org.apache.tinkerpop.gremlin.process.traversal.Path; //导入方法依赖的package包/类
protected ReferencePath(final Path path) {
path.forEach((object, labels) -> {
if (object instanceof ReferenceElement || object instanceof ReferenceProperty || object instanceof ReferencePath) {
this.objects.add(object);
this.labels.add(new HashSet<>(labels));
} else if (object instanceof Element) {
this.objects.add(ReferenceFactory.detach((Element) object));
this.labels.add(new HashSet<>(labels));
} else if (object instanceof Property) {
this.objects.add(ReferenceFactory.detach((Property) object));
this.labels.add(new HashSet<>(labels));
} else if (object instanceof Path) {
this.objects.add(ReferenceFactory.detach((Path) object));
this.labels.add(new HashSet<>(labels));
} else {
this.objects.add(object);
this.labels.add(new HashSet<>(labels));
}
});
}