本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.Edge.vertices方法的典型用法代码示例。如果您正苦于以下问题:Java Edge.vertices方法的具体用法?Java Edge.vertices怎么用?Java Edge.vertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.structure.Edge
的用法示例。
在下文中一共展示了Edge.vertices方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testReturnOutThenInOnVertexIterator
import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
@Test
public void testReturnOutThenInOnVertexIterator() {
UUID factID = mockFact(null);
UUID inVertexObjectID = mockObject();
UUID outVertexObjectID = mockObject();
Edge edge = new FactEdge(getActGraph(), factID, inVertexObjectID, outVertexObjectID);
assertEquals(outVertexObjectID, edge.outVertex().id());
assertEquals(inVertexObjectID, edge.inVertex().id());
Iterator<Vertex> vertices = edge.vertices(Direction.BOTH);
assertTrue(vertices.hasNext());
assertEquals(outVertexObjectID, vertices.next().id());
assertTrue(vertices.hasNext());
assertEquals(inVertexObjectID, vertices.next().id());
assertFalse(vertices.hasNext());
}
示例2: testVerticesWithDirectionIn
import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
@Test
public void testVerticesWithDirectionIn() {
UUID factID = mockFact(null);
UUID inVertexObjectID = mockObject();
UUID outVertexObjectID = mockObject();
Edge edge = new FactEdge(getActGraph(), factID, inVertexObjectID, outVertexObjectID);
Iterator<Vertex> vertices = edge.vertices(Direction.IN);
assertSame(inVertexObjectID, vertices.next().id());
assertFalse(vertices.hasNext());
}
示例3: testVerticesWithDirectionOut
import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
@Test
public void testVerticesWithDirectionOut() {
UUID factID = mockFact(null);
UUID inVertexObjectID = mockObject();
UUID outVertexObjectID = mockObject();
Edge edge = new FactEdge(getActGraph(), factID, inVertexObjectID, outVertexObjectID);
Iterator<Vertex> vertices = edge.vertices(Direction.OUT);
assertSame(outVertexObjectID, vertices.next().id());
assertFalse(vertices.hasNext());
}
示例4: testVerticesWithDirectionBoth
import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
@Test
public void testVerticesWithDirectionBoth() {
UUID factID = mockFact(null);
UUID inVertexObjectID = mockObject();
UUID outVertexObjectID = mockObject();
Edge edge = new FactEdge(getActGraph(), factID, inVertexObjectID, outVertexObjectID);
Iterator<Vertex> vertices = edge.vertices(Direction.BOTH);
assertSame(outVertexObjectID, vertices.next().id());
assertSame(inVertexObjectID, vertices.next().id());
assertFalse(vertices.hasNext());
}
示例5: convert
import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
@Override
public Vertex convert(Edge item) {
Iterator<Vertex> vertices = item.vertices(direction);
if(vertices.hasNext()) {
return vertices.next();
}
return null;
}