本文整理汇总了Java中org.neo4j.graphdb.Relationship.hasProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Relationship.hasProperty方法的具体用法?Java Relationship.hasProperty怎么用?Java Relationship.hasProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.graphdb.Relationship
的用法示例。
在下文中一共展示了Relationship.hasProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEdge
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
@Override
public Edge getEdge(long id1, long id2) {
Edge edge = null;
try {
beginTransaction();
Relationship rel = getInnerRelationship(id1, id2);
if (rel != null) {
Vertex v1 = getVertex(id1);
Vertex v2 = getVertex(id2);
int weigth = 0;
if (rel.hasProperty(NetworkNeo4jProperties.WEIGHT)) {
weigth = (int) rel.getProperty(NetworkNeo4jProperties.WEIGHT);
}
long id = (long) rel.getProperty(NetworkNeo4jProperties.INDEX);
edge = new Edge(id, weigth, v1, v2);
}
} finally {
endTransaction();
}
return edge;
}
示例2: compute
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
@Override
public void compute(Relationship r) {
Node n1 = r.getStartNode();
Node n2 = r.getEndNode();
if( n1.getProperty(attName) == n2.getProperty(attName) ) {
double weight = r.hasProperty("weight") ? (double) r.getProperty("weight") : 1.0;
eii += weight;
}
}