Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.net
Class BasicResultFilter

java.lang.Object
  extended by com.jivesoftware.forum.net.BasicResultFilter

public class BasicResultFilter
extends java.lang.Object

A convenience result filter designed to restrict list results for display in UI.

The basic result filter implements the most common result filter allowing the specification of the start index and maximum number of results to return on any given list.


Field Summary
static int NO_RESULT_LIMIT
          Indicates that no result limit should be enforced.
 
Constructor Summary
BasicResultFilter()
          Empty constructor creating a default filter with start index 0, and number of results unlimited.
BasicResultFilter(int start, int maxResults)
          Constructor that sets the start index 0, and number of results.
 
Method Summary
 java.util.Iterator filter(java.util.Iterator rawResults)
          Filters the raw results according to it's current settings and returns an iterator over the result.
 int getNumResults()
          Returns the max number of results that should be returned.
 int getStartIndex()
          Returns the index of the first result to return.
 void setNumResults(int num)
          Sets the limit on the number of results to be returned.
 void setStartIndex(int start)
          Sets the index of the first result to return.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_RESULT_LIMIT

public static final int NO_RESULT_LIMIT
Indicates that no result limit should be enforced.

See Also:
Constant Field Values
Constructor Detail

BasicResultFilter

public BasicResultFilter()

Empty constructor creating a default filter with start index 0, and number of results unlimited.


BasicResultFilter

public BasicResultFilter(int start,
                         int maxResults)

Constructor that sets the start index 0, and number of results.

Parameters:
start - the start index for the results.
maxResults - the maximum number of workgroups to include in the result.
Method Detail

getNumResults

public int getNumResults()

Returns the max number of results that should be returned.

The default value for is NO_RESULT_LIMIT, which means there will be no limit on the number of results. This method can be used in combination with setStartIndex(int) to perform pagination of results.

Returns:
the max number of results to return or NO_RESULT_LIMIT for no limit.

setNumResults

public void setNumResults(int num)

Sets the limit on the number of results to be returned.

User NO_RESULT_LIMIT if you don't want to limit the results returned.

Parameters:
num - the number of results to return or NO_RESULT_LIMIT for no limit.

getStartIndex

public int getStartIndex()
Returns the index of the first result to return.

Returns:
the index of the first result which should be returned.

setStartIndex

public void setStartIndex(int start)
Sets the index of the first result to return. For example, if the start index is set to 20, the Iterator returned will start at the 20th result in the query. This method can be used in combination with setNumResults(int) to perform pagination of results.

Parameters:
start - the index of the first result to return.

filter

public java.util.Iterator filter(java.util.Iterator rawResults)

Filters the raw results according to it's current settings and returns an iterator over the result.

Parameters:
rawResults - Iterator over all support group members.
Returns:
Iterator over group members fitting the current filter settings.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.