+ 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);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasChild(E element) {
+ for (Node<E> childNode: children) {
+ if (childNode.getElement().equals(element)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getIndexOfChild(Node<E> childNode) {
+ int childIndex = 0;
+ for (Node<E> node: children) {
+ if (node.equals(childNode)) {
+ return childIndex;
+ }
+ childIndex++;
+ }
+ return -1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getIndexOfChild(E element) {
+ int childIndex = 0;
+ for (Node<E> node: children) {
+ if (node.getElement().equals(element)) {
+ return childIndex;
+ }
+ childIndex++;
+ }
+ return -1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */