本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.Traverser.get方法的典型用法代码示例。如果您正苦于以下问题:Java Traverser.get方法的具体用法?Java Traverser.get怎么用?Java Traverser.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.process.traversal.Traverser
的用法示例。
在下文中一共展示了Traverser.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.tinkerpop.gremlin.process.traversal.Traverser; //导入方法依赖的package包/类
@Override
public Map<String, List<Property>> apply(final Traverser<Map<String, List<Property>>> mapTraverser) {
final Map<String,List<Property>> values = mapTraverser.get();
final Map<String,List<Property>> filtered = new HashMap<>();
// note the final filter that removes the partitionKey from the outgoing Map
values.entrySet().forEach(p -> {
final List l = p.getValue().stream().filter(property -> {
if (property instanceof VertexProperty) {
final Iterator<String> itty = ((VertexProperty) property).values(partitionKey);
return itty.hasNext() && readPartitions.contains(itty.next());
} else {
return true;
}
}).filter(property -> !property.key().equals(partitionKey)).collect(Collectors.toList());
if (l.size() > 0) filtered.put(p.getKey(), l);
});
return filtered;
}
示例2: fromVertex
import org.apache.tinkerpop.gremlin.process.traversal.Traverser; //导入方法依赖的package包/类
public static GephiNode fromVertex(Traverser<Vertex> v) {
Vertex vertex = v.get();
return new GephiNode()
.id(GephiFormat.computeElementId(vertex))
.label(GephiFormat.computeNodeLabel(vertex))
.size(GephiFormat.computeNodeSize(vertex))
.attributes(GephiFormat.computeNodeAttributes(vertex));
}
示例3: fromEdge
import org.apache.tinkerpop.gremlin.process.traversal.Traverser; //导入方法依赖的package包/类
public static GephiEdge fromEdge(Traverser<Edge> e) {
Edge edge = e.get();
return new GephiEdge()
.id(GephiFormat.computeElementId(edge))
.source(GephiFormat.computeElementId(edge.outVertex()))
.target(GephiFormat.computeElementId(edge.inVertex()))
.title(edge.label());
}
示例4: tryUnrollTraverser
import org.apache.tinkerpop.gremlin.process.traversal.Traverser; //导入方法依赖的package包/类
private void tryUnrollTraverser(final ResultQueue queue, final Object item) {
if (unrollTraversers && item instanceof Traverser) {
final Traverser t = (Traverser) item;
final Object traverserObject = t.get();
for (long ix = 0; ix < t.bulk(); ix++) {
queue.add(new Result(traverserObject));
}
} else {
queue.add(new Result(item));
}
}