当前位置: 首页>>代码示例>>Java>>正文


Java Edge.remove方法代码示例

本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.Edge.remove方法的典型用法代码示例。如果您正苦于以下问题:Java Edge.remove方法的具体用法?Java Edge.remove怎么用?Java Edge.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tinkerpop.gremlin.structure.Edge的用法示例。


在下文中一共展示了Edge.remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldRemoveEdgeFromAnIndex

import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
@Test
public void shouldRemoveEdgeFromAnIndex() {
    final TinkerGraph g = TinkerGraph.open();
    g.createIndex("oid", Edge.class);

    final Vertex v = g.addVertex();
    v.addEdge("friend", v, "oid", "1", "weight", 0.5f);
    final Edge e = v.addEdge("friend", v, "oid", "1", "weight", 0.5f);
    v.addEdge("friend", v, "oid", "2", "weight", 0.6f);

    // a tricky way to evaluate if indices are actually being used is to pass a fake BiPredicate to has()
    // to get into the Pipeline and evaluate what's going through it.  in this case, we know that at index
    // is used because only oid 1 should pass through the pipeline due to the inclusion of the
    // key index lookup on "oid".  If there's an weight of something other than 0.5f in the pipeline being
    // evaluated then something is wrong.
    assertEquals(new Long(2), g.traversal().E().has("weight", P.test((t, u) -> {
        assertEquals(0.5f, t);
        return true;
    }, 0.5)).has("oid", "1").count().next());

    e.remove();
    assertEquals(new Long(1), g.traversal().E().has("weight", P.test((t, u) -> {
        assertEquals(0.5f, t);
        return true;
    }, 0.5)).has("oid", "1").count().next());
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:27,代码来源:TinkerGraphTest.java

示例2: removeEdgeCleanly

import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
private void removeEdgeCleanly(final Edge edge) {
    Vertex outV = edge.outVertex();
    Vertex inV = edge.inVertex();
    edge.remove();
    removeIfIsolated(outV);
    removeIfIsolated(inV);
}
 
开发者ID:joshsh,项目名称:graphsail,代码行数:8,代码来源:DataStore.java

示例3: removeEdge

import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
private void removeEdge(Graph graph, Edge edge) {
	edge.remove();
}
 
开发者ID:lambdazen,项目名称:bitsy,代码行数:4,代码来源:BitsyGraphIT.java


注:本文中的org.apache.tinkerpop.gremlin.structure.Edge.remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。