Node: {streamParents => parentStream} rename method
This commit is contained in:
parent
b644fb9dd8
commit
081dfc7b37
2 changed files with 4 additions and 4 deletions
|
@ -256,5 +256,5 @@ public interface Node<T> {
|
||||||
*
|
*
|
||||||
* @return a stream of the node's parents recursively until the root node
|
* @return a stream of the node's parents recursively until the root node
|
||||||
*/
|
*/
|
||||||
Stream<Node<T>> streamParents();
|
Stream<Node<T>> parentStream();
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,8 +377,8 @@ class NodeItem<T> implements Node<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<Node<T>> streamParents() {
|
public Stream<Node<T>> parentStream() {
|
||||||
return getParent().map(node -> Stream.concat(Stream.of(node), node.streamParents()))
|
return findParent().map(node -> Stream.concat(Stream.of(node), node.parentStream()))
|
||||||
.orElseGet(Stream::empty);
|
.orElseGet(Stream::empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue