add getChild(E)
[jSite2.git] / src / net / pterodactylus / util / data / NodeImpl.java
index 5c04aee..785fa1f 100644 (file)
@@ -87,6 +87,18 @@ class NodeImpl<E> implements Node<E> {
        /**
         * {@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);
        }