net.sourceforge.rssowl.util.archive
Class Archive

java.lang.Object
  extended bynet.sourceforge.rssowl.util.archive.Archive

public class Archive
extends Object

The Archive stores all archive items in a Hashtable. Each archive item can be found through the feedurl in the Hashtable.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  ArchiveManager archiveManager
           
private  Hashtable items
           
 
Constructor Summary
Archive(ArchiveManager archiveManager)
          Instantiate a new Archive
 
Method Summary
 void addEntry(NewsItem rssNewsItem)
          Add an entry to the ArchiveItem that is connected to the feedurl of the given NewsItem.
 void addEntry(String feedurl, String newstitle, String newsurl, String newsdate)
          Add an entry to the ArchiveItem that is connected to the feedurl.
 void addItem(ArchiveItem item)
          Add an archive item to the archive
 void cleanUpItem(String feedurl, Hashtable newsItems)
          Remove any archive entries from the archive item, that are not part of the given news items.
 ArchiveItem getItem(String feedurl)
          Get an archive item from the archive
 Enumeration getKeys()
          Get all feedurl's of the archive as Enumeration
 boolean isNewsRead(NewsItem rssNewsItem)
          Check if the given newsitem is read or not.
 boolean isNewsRead(String feedurl, String newstitle, String newsurl, String newsdate)
          Check if the given newsitem is read or not.
 void removeEntry(NewsItem rssNewsItem)
          Remove an archive entry from an archive item.
 void removeEntry(String feedurl, String newstitle, String newsurl, String newsdate)
          Remove an archive entry from an archive item.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

archiveManager

private ArchiveManager archiveManager

items

private Hashtable items
Constructor Detail

Archive

public Archive(ArchiveManager archiveManager)
Instantiate a new Archive

Parameters:
archiveManager - The archive manager
Method Detail

addEntry

public void addEntry(NewsItem rssNewsItem)
Add an entry to the ArchiveItem that is connected to the feedurl of the given NewsItem.

Parameters:
rssNewsItem - Get feedurl, newsurl, newstitle and newsdate from this object to add a new entry.

addEntry

public void addEntry(String feedurl,
                     String newstitle,
                     String newsurl,
                     String newsdate)
Add an entry to the ArchiveItem that is connected to the feedurl.

Parameters:
feedurl - The url of the feed
newstitle - The title of the news
newsurl - The url of the news
newsdate - The publish date of the news

addItem

public void addItem(ArchiveItem item)
Add an archive item to the archive

Parameters:
item - An archive item

cleanUpItem

public void cleanUpItem(String feedurl,
                        Hashtable newsItems)
Remove any archive entries from the archive item, that are not part of the given news items. This is a simple clean up, which prevents the files of the archive from getting big.

Parameters:
feedurl - The URL of the feed
newsItems - A Hashtable with all newsitems

getItem

public ArchiveItem getItem(String feedurl)
Get an archive item from the archive

Parameters:
feedurl - The url of the feed
Returns:
ArchiveItem The archive item

getKeys

public Enumeration getKeys()
Get all feedurl's of the archive as Enumeration

Returns:
Enumeration All feedurl's of the archive

isNewsRead

public boolean isNewsRead(NewsItem rssNewsItem)
Check if the given newsitem is read or not. This is simply done by checking, if the newsitem exists as entry in the connected archive item.

Parameters:
rssNewsItem - The selected news
Returns:
TRUE if the news was read

isNewsRead

public boolean isNewsRead(String feedurl,
                          String newstitle,
                          String newsurl,
                          String newsdate)
Check if the given newsitem is read or not. This is simply done by checking, if the newsitem exists as entry in the connected archive item.

Parameters:
feedurl - URL of the feed
newstitle - Title of the news
newsurl - URL of the news
newsdate - The publish date of the news
Returns:
TRUE if the news was read

removeEntry

public void removeEntry(NewsItem rssNewsItem)
Remove an archive entry from an archive item.

Parameters:
rssNewsItem - The selected newsitem

removeEntry

public void removeEntry(String feedurl,
                        String newstitle,
                        String newsurl,
                        String newsdate)
Remove an archive entry from an archive item.

Parameters:
feedurl - URL of the feed
newstitle - Title of the news
newsurl - URL of the news
newsdate - The publish date of the news

toString

public String toString()
See Also:
Object.toString()


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo