From afec2edc48b0151823ad0696965e533b7dec9184 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 9 Apr 2013 06:59:18 +0200 Subject: [PATCH] =?utf8?q?Make=20a=20bot=20deliver=20all=20its=20packs=20w?= =?utf8?q?hen=20it=E2=80=99s=20being=20iterated=20over.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/xdcc/data/Bot.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/xdcc/data/Bot.java b/src/main/java/net/pterodactylus/xdcc/data/Bot.java index 33bec20..46bca18 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Bot.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Bot.java @@ -18,6 +18,7 @@ package net.pterodactylus.xdcc.data; import java.util.Collection; +import java.util.Iterator; import java.util.Map; import com.beust.jcommander.internal.Maps; @@ -28,7 +29,7 @@ import com.beust.jcommander.internal.Maps; * * @author David ‘Bombe’ Roden */ -public class Bot { +public class Bot implements Iterable { /** The network this bot is on. */ private final Network network; @@ -111,6 +112,15 @@ public class Bot { } // + // ITERABLE METHODS + // + + @Override + public Iterator iterator() { + return packs.values().iterator(); + } + + // // OBJECT METHODS // -- 2.7.4