com.atlassian.confluence.search.v2.filter
Class SubsetResultFilter

java.lang.Object
  extended by com.atlassian.confluence.search.v2.filter.SubsetResultFilter
All Implemented Interfaces:
ResultFilter

public class SubsetResultFilter
extends Object
implements ResultFilter

A result filter that filters out all but a particular "window" (startOffset 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.

Can also be used, with a startOffset of 0, to return the first 'n' results


Field Summary
static String KEY
           
 
Constructor Summary
SubsetResultFilter(int maxResults)
          Construct a filter that returns at most the first count hits.
SubsetResultFilter(int startOffset, int maxResults)
          Construct a filter with the given start offset and count.
 
Method Summary
 boolean equals(Object o)
           
 String getKey()
          Gets the unique key that identifies this type of result filter.
 int getMaxResults()
          Gets the maximum number of results the filter should allow through
 List getParameters()
          Gets the parameters that configure this result filter.
 int getStartOffset()
          Gets the offset of the first search result to return
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
See Also:
Constant Field Values
Constructor Detail

SubsetResultFilter

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

Parameters:
maxResults - the number of hits to return

SubsetResultFilter

public SubsetResultFilter(int startOffset,
                          int maxResults)
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
maxResults - the maximum number of hits to return
Method Detail

getStartOffset

public int getStartOffset()
Gets the offset of the first search result to return

Returns:
the start offset for results

getMaxResults

public int getMaxResults()
Gets the maximum number of results the filter should allow through

Returns:
the maximum number of results to allow

getKey

public String getKey()
Description copied from interface: ResultFilter
Gets the unique key that identifies this type of result filter.

Specified by:
getKey in interface ResultFilter
Returns:
the filter key
See Also:
ResultFilter.getKey()

getParameters

public List getParameters()
Description copied from interface: ResultFilter
Gets the parameters that configure this result filter. Parameters should either be strings, or ResultFilter implementations.

Specified by:
getParameters in interface ResultFilter
Returns:
the filter parameters
See Also:
ResultFilter.getParameters()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003-2011 Atlassian. All Rights Reserved.