de.nava.informa.utils
Class ItemComparator

java.lang.Object
  extended by de.nava.informa.utils.ItemComparator
All Implemented Interfaces:
Comparator<ItemIF>

public class ItemComparator
extends Object
implements Comparator<ItemIF>

Custom comparator for ItemIF objects, which takes the date the news item was found into account.

Author:
Niko Schmuck (niko@nava.de)

Constructor Summary
ItemComparator()
          Default constructor using ascending dates (oldes first) and using the date specified by the item (as opposed to the date the item was found by retrieving).
ItemComparator(boolean reverseOrder)
           
ItemComparator(boolean reverseOrder, boolean useFoundDate)
           
 
Method Summary
 int compare(ItemIF item1, ItemIF item2)
           
 boolean getReverseOrder()
           
 boolean getUseFoundDate()
           
 void setReverseOrder(boolean reverseOrder)
           
 void setUseFoundDate(boolean useFoundDate)
           
 
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

ItemComparator

public ItemComparator()
Default constructor using ascending dates (oldes first) and using the date specified by the item (as opposed to the date the item was found by retrieving).


ItemComparator

public ItemComparator(boolean reverseOrder)

ItemComparator

public ItemComparator(boolean reverseOrder,
                      boolean useFoundDate)
Method Detail

compare

public int compare(ItemIF item1,
                   ItemIF item2)
Specified by:
compare in interface Comparator<ItemIF>

getReverseOrder

public boolean getReverseOrder()

setReverseOrder

public void setReverseOrder(boolean reverseOrder)

getUseFoundDate

public boolean getUseFoundDate()

setUseFoundDate

public void setUseFoundDate(boolean useFoundDate)


Copyright © 2002-2007 Niko Schmuck. All Rights Reserved.