本文整理匯總了Java中org.apache.tinkerpop.gremlin.structure.Vertex.vertices方法的典型用法代碼示例。如果您正苦於以下問題:Java Vertex.vertices方法的具體用法?Java Vertex.vertices怎麽用?Java Vertex.vertices使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tinkerpop.gremlin.structure.Vertex
的用法示例。
在下文中一共展示了Vertex.vertices方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadReactedToByOriginalReactionAndVertexAndDepth
import org.apache.tinkerpop.gremlin.structure.Vertex; //導入方法依賴的package包/類
private void loadReactedToByOriginalReactionAndVertexAndDepth(final Reaction originalReaction, Vertex originalVertex, final int depth, Graph graph) throws Exception {
if (depth > 0) {
Set<Reaction> reactedTo = new LinkedHashSet<>();
originalReaction.setReactedTo(reactedTo);
for (Iterator<Vertex> reactedToVertices = originalVertex.vertices(Direction.OUT, "reactedTo"); reactedToVertices.hasNext(); ) {
Vertex reactedToVertex = reactedToVertices.next();
Reaction reactedToReaction = Reaction.fromVertex(reactedToVertex, graphUtils);
reactedTo.add(reactedToReaction);
if (depth > 1) {
loadReactedToByOriginalReactionAndVertexAndDepth(reactedToReaction, reactedToVertex, depth - 1, graph);
}
}
}
}