From 299e8850c53af29ce6c122169c76f10e89dd67bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 26 May 2008 20:54:38 +0200 Subject: [PATCH] add even more methods --- src/net/pterodactylus/util/data/Node.java | 5 +++++ src/net/pterodactylus/util/data/NodeImpl.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/net/pterodactylus/util/data/Node.java b/src/net/pterodactylus/util/data/Node.java index 3ba6004..37588b5 100644 --- a/src/net/pterodactylus/util/data/Node.java +++ b/src/net/pterodactylus/util/data/Node.java @@ -110,6 +110,11 @@ public interface Node extends Iterable> { public void removeChild(int childIndex); /** + * Removes all children from this node. + */ + public void removeAllChildren(); + + /** * {@inheritDoc} */ public Iterator> iterator(); diff --git a/src/net/pterodactylus/util/data/NodeImpl.java b/src/net/pterodactylus/util/data/NodeImpl.java index 2d57876..283a663 100644 --- a/src/net/pterodactylus/util/data/NodeImpl.java +++ b/src/net/pterodactylus/util/data/NodeImpl.java @@ -148,6 +148,13 @@ class NodeImpl implements Node { /** * {@inheritDoc} */ + public void removeAllChildren() { + children.clear(); + } + + /** + * {@inheritDoc} + */ public Iterator> iterator() { return children.iterator(); } -- 2.7.4