net.sourceforge.rssowl.controller.sort
Class AbstractSorter

java.lang.Object
  extended bynet.sourceforge.rssowl.controller.sort.AbstractSorter
All Implemented Interfaces:
Comparator
Direct Known Subclasses:
AuthorSorter, CategorySorter, NewsFeedSorter, PubDateSorter, PublisherSorter, StatusSorter, TitleSorter

public abstract class AbstractSorter
extends Object
implements Comparator

Abstract class implementing Comparator and taking a Hashtable of RSSNewsItems as the list of elements givin the ordering consists of keys to retrieve those RSSNewsItems from the Hashtable.

Version:
1.1.3
Author:
Ludovic Kim-Xuan Galibert

Field Summary
private  Hashtable items
          Holds the Hashtable of RSSNewsItems
 
Constructor Summary
protected AbstractSorter(Hashtable someItems)
          Creates a new instance of AbstractSorter.
 
Method Summary
protected  int completeCompare(Object o1, Object o2)
          This method is called in case two newsitems with the same values where compared with.
protected  Hashtable getItems()
          Gets the Hashtable of RSSNewsItems.
protected  void setItems(Hashtable someItems)
          Sets the Hashtable of RSSNewsItems.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Field Detail

items

private Hashtable items
Holds the Hashtable of RSSNewsItems

Constructor Detail

AbstractSorter

protected AbstractSorter(Hashtable someItems)
Creates a new instance of AbstractSorter.

Parameters:
someItems - a Hashtable containing RSSNewsItems, may be null.
Method Detail

completeCompare

protected int completeCompare(Object o1,
                              Object o2)
This method is called in case two newsitems with the same values where compared with. This is most common in case newsitems are first sorted by status. In that case, this method will try to sort the two newsitems by other items from the sortOrder Vector.

Parameters:
o1 - the first key (news title) to retrieve the first NewsItem to compare
o2 - the second key (news title) to retrieve the second NewsItem to compare
Returns:
-1 if the first NewsItem is alphabetically before the second, and 1 if the second NewsItem is alphabetically before the first.

getItems

protected Hashtable getItems()
Gets the Hashtable of RSSNewsItems.

Returns:
a Hashtable containing RSSNewsItems, may be null.

setItems

protected void setItems(Hashtable someItems)
Sets the Hashtable of RSSNewsItems.

Parameters:
someItems - a Hashtable containing RSSNewsItems, may be null.


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo