提交 ea2d0ead 编写于 作者: V vromero

6473148: TreePath.iterator() should document the iteration order

Reviewed-by: mcimadamore
上级 0d44bf75
......@@ -125,18 +125,25 @@ public class TreePath implements Iterable<Tree> {
return parent;
}
/**
* Iterates from leaves to root.
*/
@Override
public Iterator<Tree> iterator() {
return new Iterator<Tree>() {
@Override
public boolean hasNext() {
return next != null;
}
@Override
public Tree next() {
Tree t = next.leaf;
next = next.parent;
return t;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册