org.apache.tinkerpop.gremlin.process.traversal.Traversal.toSet()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.apache.tinkerpop.gremlin.process.traversal.Traversal.toSet()方法的一些代码示例,展示了Traversal.toSet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Traversal.toSet()方法的具体详情如下:
包路径:org.apache.tinkerpop.gremlin.process.traversal.Traversal
类名称:Traversal
方法名:toSet

Traversal.toSet介绍

[英]Put all the results into a HashSet.
[中]将所有结果放入哈希集中。

代码示例

代码示例来源:origin: apache/tinkerpop

final Set<Integer> set = intTraversal.toSet();
assertFalse(intTraversal.hasNext());
assertEquals(4, set.size());

代码示例来源:origin: org.jboss.windup.web.addons/windup-web-support-impl

@Override
public List<Map<String, Object>> getByType(Long executionID, String vertexType, String propertyName, String propertyValue, Integer depth, Boolean dedup, Boolean includeInVertices)
{
  GraphContext graphContext = getGraph(executionID);
  List<Map<String, Object>> vertices = new ArrayList<>();
  Traversal<Vertex, Vertex> query = graphContext.getGraph().traversal().V().has(WindupVertexFrame.TYPE_PROP, vertexType).has(propertyName, propertyValue);
  for (Vertex vertex : query.toSet())
  {
    vertices.add(convertToMap(new GraphMarshallingContext(executionID, vertex, depth, dedup, null, null, null, includeInVertices), vertex));
  }
  return vertices;
}

代码示例来源:origin: org.apache.tinkerpop/gremlin-test

final Set<Integer> set = intTraversal.toSet();
assertFalse(intTraversal.hasNext());
assertEquals(4, set.size());

相关文章