From 109600515d4c561d4219fd5c977b5e205e790519 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 30 Mar 2011 07:29:01 +0200 Subject: [PATCH] Add filter that removes not-downloaded Sones. --- src/main/java/net/pterodactylus/sone/data/Sone.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index cc54697..a1aa6ee 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -29,6 +29,7 @@ import java.util.logging.Logger; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.template.SoneAccessor; +import net.pterodactylus.util.filter.Filter; import net.pterodactylus.util.logging.Logging; import freenet.keys.FreenetURI; @@ -56,6 +57,15 @@ public class Sone implements Fingerprintable, Comparable { }; + /** Filter to remove Sones that have not been downloaded. */ + public static final Filter EMPTY_SONE_FILTER = new Filter() { + + @Override + public boolean filterObject(Sone sone) { + return sone.getTime() != 0; + } + }; + /** The logger. */ private static final Logger logger = Logging.getLogger(Sone.class); -- 2.7.4