public Node<E> getChild(int index);
/**
+ * Returns the direct child node that contains the given element.
+ *
+ * @param element
+ * The element
+ * @return The direct child node containing the given element, or
+ * <code>null</code> if this node does not have a child node
+ * containing the given element
+ */
+ public Node<E> getChild(E element);
+
+ /**
* Returns whether the given node is a direct child of this node.
*
* @param childNode
/**
* {@inheritDoc}
*/
+ public Node<E> getChild(E element) {
+ for (Node<E> childNode: children) {
+ if (childNode.getElement().equals(element)) {
+ return childNode;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public boolean hasChild(Node<E> childNode) {
return children.contains(childNode);
}