com.atlassian.confluence.search.v2.lucene
Class LuceneSubsetResultFilter

java.lang.Object
  extended by com.atlassian.confluence.search.v2.lucene.LuceneSubsetResultFilter
All Implemented Interfaces:
LuceneResultFilter

public class LuceneSubsetResultFilter
extends java.lang.Object
implements LuceneResultFilter

A result filter that filters out all but a particular "window" (offset from start, count) of results. Depending on the number of results in the hit set being filtered, there may be fewer than count results returned, or even none at all.

If offset is zero, has the effect of limiting the number of results.


Constructor Summary
LuceneSubsetResultFilter(int count)
          Construct a filter that returns at most the first count hits.
LuceneSubsetResultFilter(int startOffset, int count)
          Construct a filter with the given start offset and count.
 
Method Summary
 int getExpectedResultsCount()
          The number of results that the filter expects to allow into the final search result.
 boolean isIncludedInResults(WrappedHit hit)
           
 boolean shouldContinueIterating()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneSubsetResultFilter

public LuceneSubsetResultFilter(int count)
Construct a filter that returns at most the first count hits. This is the equivalent of new LuceneSubsetResultFilter(0, count).

Parameters:
count - the number of hits to return

LuceneSubsetResultFilter

public LuceneSubsetResultFilter(int startOffset,
                                int count)
Construct a filter with the given start offset and count. Offsets are zero-based, so an offset of 0 means "start at the first hit".

Parameters:
startOffset - the zero-based offset of the first hit to return
count - the maximum number of hits to return
Method Detail

isIncludedInResults

public boolean isIncludedInResults(WrappedHit hit)
Specified by:
isIncludedInResults in interface LuceneResultFilter
See Also:
LuceneResultFilter.isIncludedInResults(WrappedHit)

shouldContinueIterating

public boolean shouldContinueIterating()
Specified by:
shouldContinueIterating in interface LuceneResultFilter
See Also:
LuceneResultFilter.shouldContinueIterating()

getExpectedResultsCount

public int getExpectedResultsCount()
Description copied from interface: LuceneResultFilter
The number of results that the filter expects to allow into the final search result. This is used as a purely advisory number to initialise the size of collections, and so on. Returning a number less than or equal to zero indicates that the filter has no idea how many results it is likely to return.

Specified by:
getExpectedResultsCount in interface LuceneResultFilter
Returns:
the number of results the filter expects to permit in the search results, or zero if no prediction can be made.
See Also:
LuceneResultFilter.getExpectedResultsCount()


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.