Return true if this node or any of its children satisfy 'predicate'.
(
Predicate<? super C> predicate)
| 180 | * Return true if this node or any of its children satisfy 'predicate'. |
| 181 | */ |
| 182 | @SuppressWarnings("unchecked") |
| 183 | public <C extends TreeNode<NodeType>> boolean contains( |
| 184 | Predicate<? super C> predicate) { |
| 185 | if (predicate.apply((C) this)) return true; |
| 186 | for (NodeType child: children_) if (child.contains(predicate)) return true; |
| 187 | return false; |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Return true if this node or any of its children is an instance of class 'cl'. |