net.sourceforge.nite.util
Class SearchResultTimeComparator
java.lang.Object
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
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 |
SearchResultTimeComparator
public SearchResultTimeComparator()
compare
public int compare(java.lang.Object obj,
java.lang.Object obj1)
- Specified by:
compare
in interface java.util.Comparator