本文整理汇总了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());
}
示例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);
}
示例3: removeEdge
import org.apache.tinkerpop.gremlin.structure.Edge; //导入方法依赖的package包/类
private void removeEdge(Graph graph, Edge edge) {
edge.remove();
}