use of org.neo4j.helpers.collection.NestingIterator in project neo4j by neo4j.
the class OrderedByTypeExpander method doExpand.
@Override
Iterator<Relationship> doExpand(final Path path, BranchState state) {
final Node node = path.endNode();
return new NestingIterator<Relationship, Pair<RelationshipType, Direction>>(orderedTypes.iterator()) {
@Override
protected Iterator<Relationship> createNestedIterator(Pair<RelationshipType, Direction> entry) {
RelationshipType type = entry.first();
Direction dir = entry.other();
return ((dir == Direction.BOTH) ? node.getRelationships(type) : node.getRelationships(type, dir)).iterator();
}
};
}
use of org.neo4j.helpers.collection.NestingIterator in project graphdb by neo4j-attic.
the class OrderedByTypeExpander method doExpand.
@Override
Iterator<Relationship> doExpand(final Node start) {
return new NestingIterator<Relationship, RelationshipType>(new ArrayIterator<RelationshipType>(types)) {
@Override
protected Iterator<Relationship> createNestedIterator(RelationshipType type) {
Direction dir = directions.get(type.name());
dir = (dir == null) ? Direction.BOTH : dir;
return ((dir == Direction.BOTH) ? start.getRelationships(type) : start.getRelationships(type, dir)).iterator();
}
};
}
use of org.neo4j.helpers.collection.NestingIterator in project neo4j-mobile-android by neo4j-contrib.
the class OrderedByTypeExpander method doExpand.
@Override
Iterator<Relationship> doExpand(final Node start) {
return new NestingIterator<Relationship, Pair<RelationshipType, Direction>>(orderedTypes.iterator()) {
@Override
protected Iterator<Relationship> createNestedIterator(Pair<RelationshipType, Direction> entry) {
RelationshipType type = entry.first();
Direction dir = entry.other();
return ((dir == Direction.BOTH) ? start.getRelationships(type) : start.getRelationships(type, dir)).iterator();
}
};
}
Aggregations