model
Class ArticleComparator

java.lang.Object
  extended by model.ArticleComparator
All Implemented Interfaces:
java.util.Comparator<Article>

public class ArticleComparator
extends java.lang.Object
implements java.util.Comparator<Article>

Comparitor class to compare articles by date

Author:
mherdeg

Constructor Summary
ArticleComparator()
           
 
Method Summary
 int compare(Article a1, Article a2)
          Compare returns 1 if at was published before at, 0 if they were published at the same time, and -1 if a1 was published after a2
 
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

ArticleComparator

public ArticleComparator()
Method Detail

compare

public int compare(Article a1,
                   Article a2)
Compare returns 1 if at was published before at, 0 if they were published at the same time, and -1 if a1 was published after a2

Specified by:
compare in interface java.util.Comparator<Article>
Parameters:
a1 - Article
a2 - Article return int