2 * Sone - CoreListenerManager.java - Copyright © 2010 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.core;
20 import net.pterodactylus.sone.data.Post;
21 import net.pterodactylus.sone.data.Reply;
22 import net.pterodactylus.sone.data.Sone;
23 import net.pterodactylus.util.event.AbstractListenerManager;
26 * Manager for {@link CoreListener}s.
28 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
30 public class CoreListenerManager extends AbstractListenerManager<Core, CoreListener> {
33 * Creates a new core listener manager.
38 public CoreListenerManager(Core source) {
47 * Notifies all listeners that the given Sone is now being rescued.
49 * @see CoreListener#rescuingSone(Sone)
51 * The Sone that is being rescued
53 void fireRescuingSone(Sone sone) {
54 for (CoreListener coreListener : getListeners()) {
55 coreListener.rescuingSone(sone);
60 * Notifies all listeners that the given Sone was rescued.
62 * @see CoreListener#rescuedSone(Sone)
64 * The Sone that was rescued
66 void fireRescuedSone(Sone sone) {
67 for (CoreListener coreListener : getListeners()) {
68 coreListener.rescuedSone(sone);
73 * Notifies all listeners that a new Sone has been discovered.
75 * @see CoreListener#newSoneFound(Sone)
79 void fireNewSoneFound(Sone sone) {
80 for (CoreListener coreListener : getListeners()) {
81 coreListener.newSoneFound(sone);
86 * Notifies all listeners that a new post has been found.
88 * @see CoreListener#newPostFound(Post)
92 void fireNewPostFound(Post post) {
93 for (CoreListener coreListener : getListeners()) {
94 coreListener.newPostFound(post);
99 * Notifies all listeners that a new reply has been found.
101 * @see CoreListener#newReplyFound(Reply)
105 void fireNewReplyFound(Reply reply) {
106 for (CoreListener coreListener : getListeners()) {
107 coreListener.newReplyFound(reply);
112 * Notifies all listeners that the given Sone is now marked as known.
114 * @see CoreListener#markSoneKnown(Sone)
118 void fireMarkSoneKnown(Sone sone) {
119 for (CoreListener coreListener : getListeners()) {
120 coreListener.markSoneKnown(sone);
125 * Notifies all listeners that the given post is now marked as known.
130 void fireMarkPostKnown(Post post) {
131 for (CoreListener coreListener : getListeners()) {
132 coreListener.markPostKnown(post);
137 * Notifies all listeners that the given reply is now marked as known.
142 void fireMarkReplyKnown(Reply reply) {
143 for (CoreListener coreListener : getListeners()) {
144 coreListener.markReplyKnown(reply);