本文整理了Java中org.apache.tinkerpop.gremlin.structure.Element.values()
方法的一些代码示例,展示了Element.values()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.values()
方法的具体详情如下:
包路径:org.apache.tinkerpop.gremlin.structure.Element
类名称: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;
}
}
内容来源于网络,如有侵权,请联系作者删除!