net.sourceforge.rssowl.util.archive
Class ArchiveIndex

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

public class ArchiveIndex
extends java.lang.Object

The index of the archive contains of a simple Hashtable that holds keys and values: - Key: Unique feedurl - Value: Unique filename Any feedurl from the index points to the file that stores the archive item of the feedurl.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
private  ArchiveManager archiveManager
           
private  boolean dirty
           
private  java.util.Hashtable index
           
 
Constructor Summary
ArchiveIndex(ArchiveManager archiveManager)
          Instantiate a new ArchiveIndex
 
Method Summary
 void addIndex(java.lang.String key, java.lang.String value)
          Add a new item to the index
 java.util.Hashtable getIndex()
           
 java.lang.String getValue(java.lang.String key)
          Get the value for the given key
 boolean isDirty()
          Check wether this Index has changed since it has been loaded from the File.
 void removeIndex(java.lang.Object key)
          Remove an item from the index
 void setDirty(boolean dirty)
          Set wether this Index has changed since it has been loaded from the File and needs to be saved to the File again on shutdown.
 void syncFileName(ArchiveItem archiveItem)
          Synchronise the filename for the archiv item with the index.
 java.lang.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

dirty

private boolean dirty

index

private java.util.Hashtable index
Constructor Detail

ArchiveIndex

public ArchiveIndex(ArchiveManager archiveManager)
Instantiate a new ArchiveIndex

Parameters:
archiveManager - The archiv manager
Method Detail

addIndex

public void addIndex(java.lang.String key,
                     java.lang.String value)
Add a new item to the index

Parameters:
key - The feedurl
value - The filename of the archive item

getIndex

public java.util.Hashtable getIndex()
Returns:
Hashtable The actual index Hashtable.

getValue

public java.lang.String getValue(java.lang.String key)
Get the value for the given key

Parameters:
key - Any existing feedurl of the index
Returns:
String The filename of the archive item

isDirty

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

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

removeIndex

public void removeIndex(java.lang.Object key)
Remove an item from the index

Parameters:
key - The key identifier for the item

setDirty

public void setDirty(boolean dirty)
Set wether this Index 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 Index has changed since it has been loaded and requires to be saved to the File again, FALSE otherwise.

syncFileName

public void syncFileName(ArchiveItem archiveItem)
Synchronise the filename for the archiv item with the index. If the archiv item is new to the index, create a new unique file and tell the index.

Parameters:
archiveItem - An archive item

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