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 a new Sone has been discovered.
49 * @see CoreListener#newSoneFound(Sone)
53 void fireNewSoneFound(Sone sone) {
54 for (CoreListener coreListener : getListeners()) {
55 coreListener.newSoneFound(sone);
60 * Notifies all listeners that a new post has been found.
62 * @see CoreListener#newPostFound(Post)
66 void fireNewPostFound(Post post) {
67 for (CoreListener coreListener : getListeners()) {
68 coreListener.newPostFound(post);
73 * Notifies all listeners that a new reply has been found.
75 * @see CoreListener#newReplyFound(Reply)
79 void fireNewReplyFound(Reply reply) {
80 for (CoreListener coreListener : getListeners()) {
81 coreListener.newReplyFound(reply);
86 * Notifies all listeners that the given Sone is now marked as known.
88 * @see CoreListener#markSoneKnown(Sone)
92 void fireMarkSoneKnown(Sone sone) {
93 for (CoreListener coreListener : getListeners()) {
94 coreListener.markSoneKnown(sone);
99 * Notifies all listeners that the given post is now marked as known.
104 void fireMarkPostKnown(Post post) {
105 for (CoreListener coreListener : getListeners()) {
106 coreListener.markPostKnown(post);
111 * Notifies all listeners that the given reply is now marked as known.
116 void fireMarkReplyKnown(Reply reply) {
117 for (CoreListener coreListener : getListeners()) {
118 coreListener.markReplyKnown(reply);