當前位置: 首頁>>代碼示例>>Java>>正文


Java Edge.getId方法代碼示例

本文整理匯總了Java中com.tinkerpop.blueprints.Edge.getId方法的典型用法代碼示例。如果您正苦於以下問題:Java Edge.getId方法的具體用法?Java Edge.getId怎麽用?Java Edge.getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.tinkerpop.blueprints.Edge的用法示例。


在下文中一共展示了Edge.getId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: copyEdge

import com.tinkerpop.blueprints.Edge; //導入方法依賴的package包/類
private static void copyEdge(Graph graph, Edge edge)
{
	Object id = edge.getId();
	if (graph.getEdge(id) != null)
	{
		return;
	}
	Vertex src = graph.getVertex(edge.getVertex(Direction.OUT).getId());
	Vertex dst = graph.getVertex(edge.getVertex(Direction.IN).getId());
	if (src != null && dst != null)
	{
		Edge e = GraphHelper.addEdge(graph, id, src, dst, edge.getLabel());
		if (e != null)
		{
			ElementHelper.copyProperties(edge, e);
		}
	}
}
 
開發者ID:octopus-platform,項目名稱:bjoern,代碼行數:19,代碼來源:FunctionExportPlugin.java

示例2: testImplicitKey

import com.tinkerpop.blueprints.Edge; //導入方法依賴的package包/類
/**
 * Test the correct application of {@link com.thinkaurelius.titan.graphdb.types.system.ImplicitKey}
 * to vertices, edges, and properties.
 *
 * Additionally tests RelationIdentifier since this is closely related to ADJACENT and TITANID implicit keys.
 */
@Test
public void testImplicitKey() {
    TitanVertex v = graph.addVertex(null), u = graph.addVertex(null);
    v.setProperty("name","Dan");
    Edge e = v.addEdge("knows",u);
    graph.commit();
    RelationIdentifier eid = (RelationIdentifier)e.getId();

    assertEquals(v.getId(),v.getProperty("id"));
    assertEquals(eid,e.getProperty("id"));
    assertEquals("knows",e.getProperty("label"));
    assertEquals(BaseVertexLabel.DEFAULT_VERTEXLABEL.getName(),v.getProperty("label"));
    assertEquals(1,v.query().labels("knows").direction(BOTH).has("id",eid).count());
    assertEquals(0,v.query().labels("knows").direction(BOTH).has("id",RelationIdentifier.get(new long[]{4,5,6,7})).count());
    assertEquals(1,v.query().labels("knows").direction(BOTH).has("$titanid",eid.getRelationId()).count());
    assertEquals(0,v.query().labels("knows").direction(BOTH).has("$titanid",110111).count());
    assertEquals(1,v.query().has("$adjacent",u.getLongId()).count());
    assertEquals(1,v.query().has("$adjacent",(int)u.getLongId()).count());
    try {
        //Not a valid vertex
         assertEquals(0,v.query().has("$adjacent",110111).count());
        fail();
    } catch (IllegalArgumentException ex) {}
    assertNotNull(graph.getEdge(eid));
    assertEquals(eid,graph.getEdge(eid).getId());

    //Test edge retrieval
}
 
開發者ID:graben1437,項目名稱:titan0.5.4-hbase1.1.1-custom,代碼行數:35,代碼來源:TitanGraphTest.java


注:本文中的com.tinkerpop.blueprints.Edge.getId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。