001: /**
002: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
003: *
004: * This program is free software; you can redistribute it and/or modify
005: * it under the terms of the latest version of the GNU Lesser General
006: * Public License as published by the Free Software Foundation;
007: *
008: * This program is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: * GNU Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public License
014: * along with this program (LICENSE.txt); if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: */package org.jamwiki.model;
017:
018: import java.util.Collection;
019: import java.util.Vector;
020: import org.jamwiki.utils.WikiLogger;
021:
022: /**
023: * Provides an object representing a watchlist object consisting of a virtual
024: * wiki and a collection of topics being watched.
025: */
026: public class Watchlist {
027:
028: private String virtualWiki = null;
029: private Collection topics = new Vector();
030: private static final WikiLogger logger = WikiLogger
031: .getLogger(Watchlist.class.getName());
032:
033: /**
034: *
035: */
036: public Watchlist() {
037: }
038:
039: /**
040: *
041: */
042: public Watchlist(String virtualWiki, Collection topics) {
043: this .virtualWiki = virtualWiki;
044: this .topics = topics;
045: }
046:
047: /**
048: *
049: */
050: public void add(String topicName) {
051: if (topicName != null) {
052: this .topics.add(topicName);
053: }
054: }
055:
056: /**
057: *
058: */
059: public boolean containsTopic(String topicName) {
060: return (topicName == null) ? false : this .topics
061: .contains(topicName);
062: }
063:
064: /**
065: *
066: */
067: public Collection getTopics() {
068: return this .topics;
069: }
070:
071: /**
072: *
073: */
074: public void setTopics(Collection topics) {
075: this .topics = topics;
076: }
077:
078: /**
079: *
080: */
081: public String getVirtualWiki() {
082: return this .virtualWiki;
083: }
084:
085: /**
086: *
087: */
088: public void remove(String topicName) {
089: if (topicName != null) {
090: this .topics.remove(topicName);
091: }
092: }
093:
094: /**
095: *
096: */
097: public void setVirtualWiki(String virtualWiki) {
098: this.virtualWiki = virtualWiki;
099: }
100: }
|