本文整理汇总了Java中org.neo4j.graphdb.Relationship.isType方法的典型用法代码示例。如果您正苦于以下问题:Java Relationship.isType方法的具体用法?Java Relationship.isType怎么用?Java Relationship.isType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.graphdb.Relationship
的用法示例。
在下文中一共展示了Relationship.isType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: accept
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
@Override
public <R, E extends Throwable> R accept(Visitor<R, E> visitor) throws E {
for (Node node : dbServices.getAllNodes()) {
if (node.hasLabel(Label.label("CompilationUnit"))) {
continue;
}
if (node.hasLabel(Label.label("SourceSpan"))) {
continue;
}
if (node.hasLabel(Label.label("SourceLocation"))) {
continue;
}
visitor.visitNode(node);
for (Relationship edge : node.getRelationships(Direction.OUTGOING)) {
if (edge.isType(RelationshipType.withName("location"))) {
continue;
}
visitor.visitRelationship(edge);
}
}
return visitor.done();
}
示例2: isJavaCodeRelationship
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
public static boolean isJavaCodeRelationship(Relationship rel){
return rel.isType(RelationshipType.withName(EXTEND))
||rel.isType(RelationshipType.withName(IMPLEMENT))
||rel.isType(RelationshipType.withName(THROW))
||rel.isType(RelationshipType.withName(PARAM))
||rel.isType(RelationshipType.withName(RT))
||rel.isType(RelationshipType.withName(HAVE_METHOD))
||rel.isType(RelationshipType.withName(HAVE_FIELD))
||rel.isType(RelationshipType.withName(CALL_METHOD))
||rel.isType(RelationshipType.withName(CALL_FIELD))
||rel.isType(RelationshipType.withName(TYPE))
||rel.isType(RelationshipType.withName(VARIABLE));
}
示例3: accept
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
@Override
public <R, E extends Throwable> R accept(Visitor<R, E> visitor) throws E {
//filternodes:
for (Node node : nodes) {
if (simple) {
if (node.hasLabel(Label.label("CompilationUnit"))) {
continue; // filternodes;
}
if (node.hasLabel(Label.label("SourceSpan"))) {
continue; // filternodes;
}
if (node.hasLabel(Label.label("SourceLocation"))) {
continue; // filternodes;
}
}
if (!cfg) {
if (node.hasLabel(Label.label("End"))) {
continue; // filternodes;
}
}
visitor.visitNode(node);
for (Relationship relationship : node.getRelationships(Direction.OUTGOING)) {
if (nodes.contains(relationship.getOtherNode(node))) {
if (relationship.isType(RelationshipType.withName("location"))) {
continue;
}
if (!cfg) {
if (relationship.isType(RelationshipType.withName("_end"))) {
continue;
}
if (relationship.isType(RelationshipType.withName("_next"))) {
// continue;
}
if (relationship.isType(RelationshipType.withName("_true"))) {
continue;
}
if (relationship.isType(RelationshipType.withName("_false"))) {
continue;
}
if (relationship.isType(RelationshipType.withName("_normal"))) {
continue;
}
}
visitor.visitRelationship(relationship);
}
}
}
return visitor.done();
}