add even more methods
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 26 May 2008 18:54:38 +0000 (20:54 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 26 May 2008 18:54:38 +0000 (20:54 +0200)
src/net/pterodactylus/util/data/Node.java
src/net/pterodactylus/util/data/NodeImpl.java

index 3ba6004..37588b5 100644 (file)
@@ -110,6 +110,11 @@ public interface Node<E> extends Iterable<Node<E>> {
        public void removeChild(int childIndex);
 
        /**
+        * Removes all children from this node.
+        */
+       public void removeAllChildren();
+
+       /**
         * {@inheritDoc}
         */
        public Iterator<Node<E>> iterator();
index 2d57876..283a663 100644 (file)
@@ -148,6 +148,13 @@ class NodeImpl<E> implements Node<E> {
        /**
         * {@inheritDoc}
         */
+       public void removeAllChildren() {
+               children.clear();
+       }
+
+       /**
+        * {@inheritDoc}
+        */
        public Iterator<Node<E>> iterator() {
                return children.iterator();
        }