本文整理汇总了Java中org.neo4j.graphdb.RelationshipType.name方法的典型用法代码示例。如果您正苦于以下问题:Java RelationshipType.name方法的具体用法?Java RelationshipType.name怎么用?Java RelationshipType.name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.graphdb.RelationshipType
的用法示例。
在下文中一共展示了RelationshipType.name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEdges
import org.neo4j.graphdb.RelationshipType; //导入方法依赖的package包/类
public Graph getEdges(RelationshipType type, boolean entail, long skip, long limit) {
String query = "MATCH path = (start)-[r:" + type.name() + (entail ? "!" : "") + "]->(end) "
+ " RETURN path "
// TODO: This slows down the query dramatically.
// + " ORDER BY ID(r) "
+ " SKIP " + skip + " LIMIT " + limit;
Graph graph = new TinkerGraph();
TinkerGraphUtil tgu = new TinkerGraphUtil(graph, curieUtil);
Result result;
try {
result = cypherUtil.execute(query);
while (result.hasNext()) {
Map<String, Object> map = result.next();
Path path = (Path) map.get("path");
tgu.addPath(path);
}
} catch (ArrayIndexOutOfBoundsException e) {
// Return and empty graph if the limit is too high...
}
return graph;
}
示例2: getAllRelationshipsOfType
import org.neo4j.graphdb.RelationshipType; //导入方法依赖的package包/类
List<RelIdIterator> getAllRelationshipsOfType( NodeManager nodeManager,
DirectionWrapper direction, RelationshipType... types)
{
ensureRelationshipMapNotNull( nodeManager );
List<RelIdIterator> relTypeList = new LinkedList<RelIdIterator>();
boolean hasModifications = nodeManager.getLockReleaser().hasRelationshipModifications( this );
for ( RelationshipType type : types )
{
String typeName = type.name();
RelIdArray src = getRelIdArray( typeName );
Collection<Long> remove = null;
RelIdArray add = null;
RelIdIterator iterator = null;
if ( hasModifications )
{
remove = nodeManager.getCowRelationshipRemoveMap( this, typeName );
add = nodeManager.getCowRelationshipAddMap( this, typeName );
iterator = new CombinedRelIdIterator( typeName, direction, src, add, remove );
}
else
{
iterator = src != null ? src.iterator( direction ) : empty( typeName ).iterator( direction );
}
relTypeList.add( iterator );
}
return relTypeList;
}
示例3: EmbeddedRelationshipType
import org.neo4j.graphdb.RelationshipType; //导入方法依赖的package包/类
public EmbeddedRelationshipType(RelationshipType delegate) {
this.delegate = delegate;
this.name = delegate.name();
}
示例4: checkTypeNameIsNotNull
import org.neo4j.graphdb.RelationshipType; //导入方法依赖的package包/类
private static void checkTypeNameIsNotNull(RelationshipType actualType) {
checkTypeIsNotNull(actualType);
if (actualType.name() == null) {
throw new IllegalStateException("The actual relationship type name should not be null");
}
}