use of org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep in project unipop by unipop-graph.
the class UniGraphPropertiesStrategy method getAllPropertyFetchersOf.
private List<PropertyFetcher> getAllPropertyFetchersOf(Step step, Traversal.Admin<?, ?> traversal) {
List<PropertyFetcher> propertyFetchers = new ArrayList<>();
Step previous = step.getPreviousStep();
while (!(previous instanceof EmptyStep)) {
if (previous instanceof PropertyFetcher)
propertyFetchers.add((PropertyFetcher) previous);
if (previous instanceof TraversalParent) {
((TraversalParent) previous).getLocalChildren().forEach(t -> t.getSteps().stream().filter(s -> s instanceof PropertyFetcher).map(p -> ((PropertyFetcher) p)).forEach(propertyFetchers::add));
((TraversalParent) previous).getGlobalChildren().forEach(t -> t.getSteps().stream().filter(s -> s instanceof PropertyFetcher).map(p -> ((PropertyFetcher) p)).forEach(propertyFetchers::add));
}
previous = previous.getPreviousStep();
}
return propertyFetchers;
}
Aggregations