// than lastModifiedLimit before present.
long targetTime = System.currentTimeMillis() - ( this.lastModifiedLimit * 60 * 1000 );
List tmpList = new ArrayList( atomicDsInfo );
for ( Iterator it = tmpList.iterator(); it.hasNext(); )
{
InvCrawlablePair curDsInfo = (InvCrawlablePair) it.next();
CrawlableDataset curCrDs = curDsInfo.getCrawlableDataset();
if ( curCrDs.lastModified().getTime() > targetTime )
{
it.remove();
}
}
// Get the maximum item according to lexigraphic comparison of InvDataset names.
return (InvCrawlablePair) Collections.max( tmpList, new Comparator()
{
public int compare( Object obj1, Object obj2 )
{
InvCrawlablePair dsInfo1 = (InvCrawlablePair) obj1;
InvCrawlablePair dsInfo2 = (InvCrawlablePair) obj2;
return ( dsInfo1.getInvDataset().getName().compareTo( dsInfo2.getInvDataset().getName() ) );
}
} );
}