net.sourceforge.nite.util
Class SearchResultTimeComparator

java.lang.Object
  extended by net.sourceforge.nite.util.SearchResultTimeComparator
All Implemented Interfaces:
java.util.Comparator

public class SearchResultTimeComparator
extends java.lang.Object
implements java.util.Comparator

This is (was) a commonly used subclass in sample programs which implements the comparator and orders search results by the start time of the first bound variable in the query. Normally called like this:
private Engine searchEngine = new net.sourceforge.nite.search.Engine();
reslist = searchEngine.search(nom, "($a segment)");
reslist.remove(0);
Collections.sort(reslist, new SearchResultTimeComparator());

The first element of a search result list is always a list of variable names and that's why we normally remove it before passing to the Comparator.

Author:
Jonathan Kilgour, UEdin

Constructor Summary
SearchResultTimeComparator()
           
 
Method Summary
 int compare(java.lang.Object obj, java.lang.Object obj1)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SearchResultTimeComparator

public SearchResultTimeComparator()
Method Detail

compare

public int compare(java.lang.Object obj,
                   java.lang.Object obj1)
Specified by:
compare in interface java.util.Comparator