Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.fm.rss.comparator
Class rssDateComparator  view rssDateComparator download rssDateComparator.java

java.lang.Object
  extended bycom.fm.rss.comparator.RssItemComparator
      extended bycom.fm.rss.comparator.rssDateComparator
All Implemented Interfaces:
java.util.Comparator

public class rssDateComparator
extends RssItemComparator

Compares RSS items by creation date


Field Summary
(package private)  boolean isReverse
           
 
Constructor Summary
rssDateComparator()
           
rssDateComparator(boolean isR)
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Return an integer that is negative, zero or positive depending on whether the first argument is less than, equal to or greater than the second according to this ordering.
 boolean equals(java.lang.Object o)
          Return true if the object is equal to this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isReverse

boolean isReverse
Constructor Detail

rssDateComparator

public rssDateComparator()

rssDateComparator

public rssDateComparator(boolean isR)
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Description copied from interface: java.util.Comparator
Return an integer that is negative, zero or positive depending on whether the first argument is less than, equal to or greater than the second according to this ordering. This method should obey the following contract:
  • if compare(a, b) < 0 then compare(b, a) > 0
  • if compare(a, b) throws an exception, so does compare(b, a)
  • if compare(a, b) < 0 and compare(b, c) < 0 then compare(a, c) < 0
  • if compare(a, b) == 0 then compare(a, c) and compare(b, c) must have the same sign
To be consistent with equals, the following additional constraint is in place:
  • if a.equals(b) or both a and b are null, then compare(a, b) == 0.

Although it is permissible for a comparator to provide an order inconsistent with equals, that should be documented.

Specified by:
compare in interface java.util.Comparator
Specified by:
compare in class RssItemComparator

equals

public boolean equals(java.lang.Object o)
Description copied from interface: java.util.Comparator
Return true if the object is equal to this object. To be considered equal, the argument object must satisfy the constraints of Object.equals(), be a Comparator, and impose the same ordering as this Comparator. The default implementation inherited from Object is usually adequate.

Specified by:
equals in interface java.util.Comparator
Specified by:
equals in class RssItemComparator