本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.Property.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Property.equals方法的具体用法?Java Property.equals怎么用?Java Property.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.structure.Property
的用法示例。
在下文中一共展示了Property.equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: approximateGraphsCheck
import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
/**
* Checks sequentially vertices and edges of both graphs. Will check sequentially Vertex IDs, Vertex Properties IDs
* and values and classes. Then same for edges. To use when serializing a Graph and deserializing the supposedly
* same Graph.
*/
private boolean approximateGraphsCheck(Graph g1, Graph g2) {
final Iterator<Vertex> itV = g1.vertices();
final Iterator<Vertex> itVRead = g2.vertices();
while (itV.hasNext()) {
final Vertex v = itV.next();
final Vertex vRead = itVRead.next();
// Will only check IDs but that's 'good' enough.
if (!v.equals(vRead)) {
return false;
}
final Iterator itVP = v.properties();
final Iterator itVPRead = vRead.properties();
while (itVP.hasNext()) {
final VertexProperty vp = (VertexProperty) itVP.next();
final VertexProperty vpRead = (VertexProperty) itVPRead.next();
if (!vp.value().equals(vpRead.value())
|| !vp.equals(vpRead)) {
return false;
}
}
}
final Iterator<Edge> itE = g1.edges();
final Iterator<Edge> itERead = g2.edges();
while (itE.hasNext()) {
final Edge e = itE.next();
final Edge eRead = itERead.next();
// Will only check IDs but that's good enough.
if (!e.equals(eRead)) {
return false;
}
final Iterator itEP = e.properties();
final Iterator itEPRead = eRead.properties();
while (itEP.hasNext()) {
final Property ep = (Property) itEP.next();
final Property epRead = (Property) itEPRead.next();
if (!ep.value().equals(epRead.value())
|| !ep.equals(epRead)) {
return false;
}
}
}
return true;
}
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:55,代码来源:TinkerGraphGraphSONSerializerV2d0Test.java