org.archive.wayback.resourceindex.filters
Class ClosestResultTrackingFilter
java.lang.Object
org.archive.wayback.resourceindex.filters.ClosestResultTrackingFilter
- All Implemented Interfaces:
- ObjectFilter<CaptureSearchResult>
public class ClosestResultTrackingFilter
- extends Object
- implements ObjectFilter<CaptureSearchResult>
Class which observes CaptureSearchResults, keeping track of the closest
result found to a given date. This class has an optimization which ASSUMES
results will be seen in increasing date order, so computation can be skipped
as soon as dates stop getting closer to the desired date.
- Author:
- brad
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClosestResultTrackingFilter
public ClosestResultTrackingFilter(long wantMS)
- Parameters:
wantMS - the number of MS since the epoch of the desired date.
getClosest
public CaptureSearchResult getClosest()
- Returns:
- the closest
filterObject
public int filterObject(CaptureSearchResult o)
- Description copied from interface:
ObjectFilter
- inpect record and determine if it should be included in the
results or not, or if processing of new records should stop.
- Specified by:
filterObject in interface ObjectFilter<CaptureSearchResult>
- Parameters:
o - Object which should be checked for inclusion/exclusion or abort
- Returns:
- int of FILTER_INCLUDE, FILTER_EXCLUDE, or FILTER_ABORT
Copyright © 2005-2011 Internet Archive. All Rights Reserved.