org.apache.tinkerpop.gremlin.structure.Element.values()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(263)

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

Element.values介绍

[英]Get the values of properties as an Iterator.
[中]以迭代器的形式获取属性值。

代码示例

代码示例来源:origin: thinkaurelius/titan

  1. @Override
  2. protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  3. if (useMultiQuery) { //it is guaranteed that all elements are vertices
  4. assert multiQueryResults != null;
  5. return convertIterator(multiQueryResults.get(traverser.get()));
  6. } else if (traverser.get() instanceof Vertex) {
  7. TitanVertexQuery query = makeQuery((TitanTraversalUtil.getTitanVertex(traverser)).query());
  8. return convertIterator(query.properties());
  9. } else {
  10. //It is some other element (edge or vertex property)
  11. Iterator<E> iter;
  12. if (getReturnType().forValues()) {
  13. assert orders.isEmpty() && hasContainers.isEmpty();
  14. iter = traverser.get().values(getPropertyKeys());
  15. } else {
  16. //this asks for properties
  17. assert orders.isEmpty();
  18. //HasContainers don't apply => empty result set
  19. if (!hasContainers.isEmpty()) return Collections.emptyIterator();
  20. iter = (Iterator<E>) traverser.get().properties(getPropertyKeys());
  21. }
  22. if (limit!=Query.NO_LIMIT) iter = Iterators.limit(iter,limit);
  23. return iter;
  24. }
  25. }

代码示例来源:origin: JanusGraph/janusgraph

  1. @Override
  2. protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  3. if (useMultiQuery) { //it is guaranteed that all elements are vertices
  4. assert multiQueryResults != null;
  5. return convertIterator(multiQueryResults.get(traverser.get()));
  6. } else if (traverser.get() instanceof JanusGraphVertex || traverser.get() instanceof WrappedVertex) {
  7. final JanusGraphVertexQuery query = makeQuery((JanusGraphTraversalUtil.getJanusGraphVertex(traverser)).query());
  8. return convertIterator(query.properties());
  9. } else {
  10. //It is some other element (edge or vertex property)
  11. Iterator<E> iterator;
  12. if (getReturnType().forValues()) {
  13. assert orders.isEmpty() && hasContainers.isEmpty();
  14. iterator = traverser.get().values(getPropertyKeys());
  15. } else {
  16. //this asks for properties
  17. assert orders.isEmpty();
  18. //HasContainers don't apply => empty result set
  19. if (!hasContainers.isEmpty()) return Collections.emptyIterator();
  20. iterator = (Iterator<E>) traverser.get().properties(getPropertyKeys());
  21. }
  22. if (limit!=Query.NO_LIMIT) iterator = Iterators.limit(iterator,limit);
  23. return iterator;
  24. }
  25. }

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

  1. @Override
  2. protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  3. return this.returnType.equals(PropertyType.VALUE) ?
  4. traverser.get().values(this.propertyKeys) :
  5. (Iterator) traverser.get().properties(this.propertyKeys);
  6. }

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

  1. @Override
  2. protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  3. return this.returnType.equals(PropertyType.VALUE) ?
  4. traverser.get().values(this.propertyKeys) :
  5. (Iterator) traverser.get().properties(this.propertyKeys);
  6. }

代码示例来源:origin: com.thinkaurelius.titan/titan-core

  1. @Override
  2. protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  3. if (useMultiQuery) { //it is guaranteed that all elements are vertices
  4. assert multiQueryResults != null;
  5. return convertIterator(multiQueryResults.get(traverser.get()));
  6. } else if (traverser.get() instanceof Vertex) {
  7. TitanVertexQuery query = makeQuery((TitanTraversalUtil.getTitanVertex(traverser)).query());
  8. return convertIterator(query.properties());
  9. } else {
  10. //It is some other element (edge or vertex property)
  11. Iterator<E> iter;
  12. if (getReturnType().forValues()) {
  13. assert orders.isEmpty() && hasContainers.isEmpty();
  14. iter = traverser.get().values(getPropertyKeys());
  15. } else {
  16. //this asks for properties
  17. assert orders.isEmpty();
  18. //HasContainers don't apply => empty result set
  19. if (!hasContainers.isEmpty()) return Collections.emptyIterator();
  20. iter = (Iterator<E>) traverser.get().properties(getPropertyKeys());
  21. }
  22. if (limit!=Query.NO_LIMIT) iter = Iterators.limit(iter,limit);
  23. return iter;
  24. }
  25. }

相关文章