net.sourceforge.rssowl.controller.sort
Class PubDateSorter

java.lang.Object
  extended bynet.sourceforge.rssowl.controller.sort.AbstractSorter
      extended bynet.sourceforge.rssowl.controller.sort.PubDateSorter
All Implemented Interfaces:
Comparator

public class PubDateSorter
extends AbstractSorter

Class used to compare two RSSNewsItems by publication date.

Version:
1.1.3
Author:
Ludovic Kim-Xuan Galibert

Field Summary
 
Fields inherited from class net.sourceforge.rssowl.controller.sort.AbstractSorter
 
Constructor Summary
PubDateSorter(Hashtable someItems)
          Creates a new instance of PubDateSorter.
 
Method Summary
 int compare(Object o1, Object o2)
          Compare the given objects by publication date.
 
Methods inherited from class net.sourceforge.rssowl.controller.sort.AbstractSorter
completeCompare, getItems, setItems
 
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
equals
 

Constructor Detail

PubDateSorter

public PubDateSorter(Hashtable someItems)
Creates a new instance of PubDateSorter.

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

compare

public int compare(Object o1,
                   Object o2)
Compare the given objects by publication date.

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:
0 if both RSSNewsItems have exactly the same publication date, -1 if the first NewsItem has been published before the second, and 1 if the second NewsItem has been published before the first.


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo