You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working with Spoon for a project and needed an iterator that would go over a CtElement's descendants in a depth-first search manner, since CtScanner does not do this one element at a time, but rather at once (using enter() and exit()) it was not fitted for my designs. So I created a CtIterator.
If you can't see why this would be needed instead of an extended CtScanner consider you have two elements and need to go through both their trees but only advance on one, when a condition is met on the other and vice-versa.
Example behaviour
CtIteratoriterator = newCtIterator(/** some CtElement*/);
while (iterator.hasNext()) {
CtElementnext = (CtElement) iterator.next();
System.out.println(next.toString());
}
If you would like me to create a PR to spoon with my implementation of CtIterator, please say so. Otherwise just close this issue.
😃
The text was updated successfully, but these errors were encountered:
I am working with Spoon for a project and needed an iterator that would go over a CtElement's descendants in a depth-first search manner, since CtScanner does not do this one element at a time, but rather at once (using
enter()
andexit()
) it was not fitted for my designs. So I created a CtIterator.If you can't see why this would be needed instead of an extended CtScanner consider you have two elements and need to go through both their trees but only advance on one, when a condition is met on the other and vice-versa.
Example behaviour
If you would like me to create a PR to spoon with my implementation of CtIterator, please say so. Otherwise just close this issue.
😃
The text was updated successfully, but these errors were encountered: