use of org.neo4j.internal.helpers.collection.NestingResourceIterator in project neo4j by neo4j.
the class OrderedByTypeExpander method doExpand.
@Override
ResourceIterator<Relationship> doExpand(final Path path, BranchState state) {
final Node node = path.endNode();
return new NestingResourceIterator<>(orderedTypes.iterator()) {
@Override
protected ResourceIterator<Relationship> createNestedIterator(Pair<RelationshipType, Direction> entry) {
RelationshipType type = entry.first();
Direction dir = entry.other();
Iterable<Relationship> relationshipsIterable = (dir == Direction.BOTH) ? node.getRelationships(type) : node.getRelationships(dir, type);
return Iterables.asResourceIterable(relationshipsIterable).iterator();
}
};
}
Aggregations