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

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

本文整理了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

@Override
protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  if (useMultiQuery) { //it is guaranteed that all elements are vertices
    assert multiQueryResults != null;
    return convertIterator(multiQueryResults.get(traverser.get()));
  } else if (traverser.get() instanceof Vertex) {
    TitanVertexQuery query = makeQuery((TitanTraversalUtil.getTitanVertex(traverser)).query());
    return convertIterator(query.properties());
  } else {
    //It is some other element (edge or vertex property)
    Iterator<E> iter;
    if (getReturnType().forValues()) {
      assert orders.isEmpty() && hasContainers.isEmpty();
      iter = traverser.get().values(getPropertyKeys());
    } else {
      //this asks for properties
      assert orders.isEmpty();
      //HasContainers don't apply => empty result set
      if (!hasContainers.isEmpty()) return Collections.emptyIterator();
      iter = (Iterator<E>) traverser.get().properties(getPropertyKeys());
    }
    if (limit!=Query.NO_LIMIT) iter = Iterators.limit(iter,limit);
    return iter;
  }
}

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

@Override
protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  if (useMultiQuery) { //it is guaranteed that all elements are vertices
    assert multiQueryResults != null;
    return convertIterator(multiQueryResults.get(traverser.get()));
  } else if (traverser.get() instanceof JanusGraphVertex || traverser.get() instanceof WrappedVertex) {
    final JanusGraphVertexQuery query = makeQuery((JanusGraphTraversalUtil.getJanusGraphVertex(traverser)).query());
    return convertIterator(query.properties());
  } else {
    //It is some other element (edge or vertex property)
    Iterator<E> iterator;
    if (getReturnType().forValues()) {
      assert orders.isEmpty() && hasContainers.isEmpty();
      iterator = traverser.get().values(getPropertyKeys());
    } else {
      //this asks for properties
      assert orders.isEmpty();
      //HasContainers don't apply => empty result set
      if (!hasContainers.isEmpty()) return Collections.emptyIterator();
      iterator = (Iterator<E>) traverser.get().properties(getPropertyKeys());
    }
    if (limit!=Query.NO_LIMIT) iterator = Iterators.limit(iterator,limit);
    return iterator;
  }
}

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

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

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

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

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

@Override
protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
  if (useMultiQuery) { //it is guaranteed that all elements are vertices
    assert multiQueryResults != null;
    return convertIterator(multiQueryResults.get(traverser.get()));
  } else if (traverser.get() instanceof Vertex) {
    TitanVertexQuery query = makeQuery((TitanTraversalUtil.getTitanVertex(traverser)).query());
    return convertIterator(query.properties());
  } else {
    //It is some other element (edge or vertex property)
    Iterator<E> iter;
    if (getReturnType().forValues()) {
      assert orders.isEmpty() && hasContainers.isEmpty();
      iter = traverser.get().values(getPropertyKeys());
    } else {
      //this asks for properties
      assert orders.isEmpty();
      //HasContainers don't apply => empty result set
      if (!hasContainers.isEmpty()) return Collections.emptyIterator();
      iter = (Iterator<E>) traverser.get().properties(getPropertyKeys());
    }
    if (limit!=Query.NO_LIMIT) iter = Iterators.limit(iter,limit);
    return iter;
  }
}

相关文章