net.sourceforge.rssowl.util.archive
Class ArchiveItem

java.lang.Object
  extended by net.sourceforge.rssowl.util.archive.ArchiveItem

public class ArchiveItem
extends java.lang.Object

An archive item is a Model Object that stores archive entries. Each archive entry consists of a newstitle, newslink and newsdate. These are used later, to determine which news of the item were read and which are unread. The archive item has a unique identifier: Its feedurl. The file attribute is set to a unique file to save the item later.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
private  boolean dirty
           
private  java.util.Hashtable entries
           
private  java.lang.String feedurl
           
private  java.io.File file
           
 
Constructor Summary
ArchiveItem(java.lang.String feedurl)
          Instantiate a new ArchiveItem
 
Method Summary
 void addEntry(ArchiveEntry rssOwlArchiveEntry)
          Add a new archive entry to this archive item
 java.util.Hashtable getEntries()
           
 java.lang.String getFeedurl()
           
 java.io.File getFile()
           
 boolean isDirty()
          Check wether this Item has changed since it has been loaded from the File.
 boolean isNewsRead(java.lang.String newstitle, java.lang.String newslink, java.lang.String newsdate)
          Check if the given newsitem is read or not.
 void removeEntry(ArchiveEntry entry)
          Remove an archive entry from this archive item.
 void removeEntry(java.lang.String newstitle, java.lang.String newslink, java.lang.String newsdate)
          Remove an archive entry from this archive item.
 void setDirty(boolean dirty)
          Set wether this Item has changed since it has been loaded from the File and needs to be saved to the File again on shutdown.
 void setFile(java.io.File file)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dirty

private boolean dirty

entries

private java.util.Hashtable entries

feedurl

private java.lang.String feedurl

file

private java.io.File file
Constructor Detail

ArchiveItem

public ArchiveItem(java.lang.String feedurl)
Instantiate a new ArchiveItem

Parameters:
feedurl - The URL of the newsfeed
Method Detail

addEntry

public void addEntry(ArchiveEntry rssOwlArchiveEntry)
Add a new archive entry to this archive item

Parameters:
rssOwlArchiveEntry - The archive entry consists of a newstitle and newslink

getEntries

public java.util.Hashtable getEntries()
Returns:
Returns the entries.

getFeedurl

public java.lang.String getFeedurl()
Returns:
Returns the feedurl.

getFile

public java.io.File getFile()
Returns:
Returns the file.

isDirty

public boolean isDirty()
Check wether this Item has changed since it has been loaded from the File.

Returns:
boolean TRUE if this Item has changed since it has been loaded and requires to be saved to the File again, FALSE otherwise.

isNewsRead

public boolean isNewsRead(java.lang.String newstitle,
                          java.lang.String newslink,
                          java.lang.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:
newstitle - Title of the news
newslink - Link of the news
newsdate - The publish date of the news
Returns:
TRUE if the news was read

removeEntry

public void removeEntry(ArchiveEntry entry)
Remove an archive entry from this archive item.

Parameters:
entry - The archive entry

removeEntry

public void removeEntry(java.lang.String newstitle,
                        java.lang.String newslink,
                        java.lang.String newsdate)
Remove an archive entry from this archive item.

Parameters:
newstitle - Title of the news
newslink - Link of the news
newsdate - The publish date of the news

setDirty

public void setDirty(boolean dirty)
Set wether this Item has changed since it has been loaded from the File and needs to be saved to the File again on shutdown.

Parameters:
dirty - Set to TRUE if this Item has changed since it has been loaded and requires to be saved to the File again, FALSE otherwise.

setFile

public void setFile(java.io.File file)
Parameters:
file - The file to set.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo