From bb075f1e55e6c0526594c8a9cd33c2afcf75cce6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 14 Nov 2010 20:43:26 +0100 Subject: [PATCH] Add method to remove a Sone, re-add isEmpty() method. --- .../sone/notify/NewSoneNotification.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/notify/NewSoneNotification.java b/src/main/java/net/pterodactylus/sone/notify/NewSoneNotification.java index 0615a79..f3388b1 100644 --- a/src/main/java/net/pterodactylus/sone/notify/NewSoneNotification.java +++ b/src/main/java/net/pterodactylus/sone/notify/NewSoneNotification.java @@ -51,6 +51,16 @@ public class NewSoneNotification extends TemplateNotification { // /** + * Returns whether there are any new Sones. + * + * @return {@code true} if there are no new Sones, {@code false} if there + * are new Sones + */ + public boolean isEmpty() { + return newSones.isEmpty(); + } + + /** * Adds a discovered Sone. * * @param sone @@ -61,6 +71,17 @@ public class NewSoneNotification extends TemplateNotification { touch(); } + /** + * Removes the given Sone from the list of new Sones. + * + * @param sone + * The Sone to remove + */ + public void removeSone(Sone sone) { + newSones.remove(sone); + touch(); + } + // // ABSTRACTNOTIFICATION METHODS // -- 2.7.4