/** * add all SearchResult objects from the SearchResults which fall * within the time range of this partition into this partition. * @param results */ public void filter(CaptureSearchResults results) { Iterator<CaptureSearchResult> itr = results.iterator(); while(itr.hasNext()) { CaptureSearchResult result = itr.next(); String captureDate = result.getCaptureTimestamp(); if((captureDate.compareTo(startDateStr) >= 0) && (captureDate.compareTo(endDateStr) < 0)) { matches.add(result); } } }
public void setCaptureContext(CaptureSearchResults results, CaptureSearchResult result) { Iterator<CaptureSearchResult> itr = results.iterator(); previous = null; next = null; this.result = result; while(itr.hasNext()) { CaptureSearchResult cur = itr.next(); if(cur.isClosest()) { break; } previous = cur; } if(itr.hasNext()) { next = itr.next(); } } public CaptureSearchResults getCaptureSearchResults() {
public void setCaptureContext(CaptureSearchResults results, CaptureSearchResult result) { Iterator<CaptureSearchResult> itr = results.iterator(); previous = null; next = null; this.result = result; while(itr.hasNext()) { CaptureSearchResult cur = itr.next(); if(cur.isClosest()) { break; } previous = cur; } if(itr.hasNext()) { next = itr.next(); } } public CaptureSearchResults getCaptureSearchResults() {
/** * add all SearchResult objects from the SearchResults which fall * within the time range of this partition into this partition. * @param results */ public void filter(CaptureSearchResults results) { Iterator<CaptureSearchResult> itr = results.iterator(); while(itr.hasNext()) { CaptureSearchResult result = itr.next(); String captureDate = result.getCaptureTimestamp(); if((captureDate.compareTo(startDateStr) >= 0) && (captureDate.compareTo(endDateStr) < 0)) { matches.add(result); } } }
Date addYear = addYear(cur,1); Date addMonth = addMonth(cur,1); Iterator<CaptureSearchResult> itr = results.iterator(); while(itr.hasNext()) { CaptureSearchResult result = itr.next();
Date addYear = addYear(cur,1); Date addMonth = addMonth(cur,1); Iterator<CaptureSearchResult> itr = results.iterator(); while(itr.hasNext()) { CaptureSearchResult result = itr.next();
/** * @param uiResults the UIResults holding replay info */ public ToolBarData(UIResults uiResults) { this.uiResults = uiResults; fmt = uiResults.getFormatter(); results = uiResults.getCaptureResults(); curResult = uiResults.getResult(); findRelativeLinks(); Date firstDate = uiResults.getWbRequest().getStartDate(); Date lastDate = uiResults.getWbRequest().getEndDate(); yearPartitions = yearPartitioner.getRange(yearSize,firstDate,lastDate); Date firstYearDate = yearPartitions.get(0).getStart(); Date lastYearDate = yearPartitions.get(yearPartitions.size()-1).getEnd(); monthPartitions = monthPartitioner.getRange(monthSize,firstYearDate,lastYearDate); Iterator<CaptureSearchResult> it = results.iterator(); monthPartitioner.populate(monthPartitions,it); yearPartitioner.populate(yearPartitions,monthPartitions.iterator()); }
/** * @param uiResults the UIResults holding replay info */ public ToolBarData(UIResults uiResults) { this.uiResults = uiResults; fmt = uiResults.getFormatter(); results = uiResults.getCaptureResults(); curResult = uiResults.getResult(); findRelativeLinks(); Date firstDate = uiResults.getWbRequest().getStartDate(); Date lastDate = uiResults.getWbRequest().getEndDate(); yearPartitions = yearPartitioner.getRange(yearSize,firstDate,lastDate); Date firstYearDate = yearPartitions.get(0).getStart(); Date lastYearDate = yearPartitions.get(yearPartitions.size()-1).getEnd(); monthPartitions = monthPartitioner.getRange(monthSize,firstYearDate,lastYearDate); Iterator<CaptureSearchResult> it = results.iterator(); monthPartitioner.populate(monthPartitions,it); yearPartitioner.populate(yearPartitions,monthPartitions.iterator()); }
private static NotableResultExtractor getNotableResults( CaptureSearchResults r) { // eventually, the NotableResultExtractor will be part of the standard // ResourceIndex.query() but for now, we'll just do an extra traversal // of the whole set of results: Iterator<CaptureSearchResult> itr = r.iterator(); Date want = r.getClosest().getCaptureDate(); NotableResultExtractor nre = new NotableResultExtractor(want); ObjectFilterIterator<CaptureSearchResult> ofi = new ObjectFilterIterator<CaptureSearchResult>( itr, nre); while (ofi.hasNext()) { ofi.next(); } return nre; } }
private static NotableResultExtractor getNotableResults( CaptureSearchResults r) { // eventually, the NotableResultExtractor will be part of the standard // ResourceIndex.query() but for now, we'll just do an extra traversal // of the whole set of results: Iterator<CaptureSearchResult> itr = r.iterator(); Date want = r.getClosest().getCaptureDate(); NotableResultExtractor nre = new NotableResultExtractor(want); ObjectFilterIterator<CaptureSearchResult> ofi = new ObjectFilterIterator<CaptureSearchResult>( itr, nre); while (ofi.hasNext()) { ofi.next(); } return nre; } }
capturePartitioner.populate(months, cResults.iterator());
capturePartitioner.populate(months, cResults.iterator());