com.atlassian.jira.issue.search
Class SearchResults

java.lang.Object
  extended bycom.atlassian.jira.issue.search.SearchResults
All Implemented Interfaces:
IssuePager

public class SearchResults
extends Object
implements IssuePager


Nested Class Summary
(package private) static class SearchResults.Page
           
 
Field Summary
protected  Collection pages
          A collection of SearchResults.Page objects
 
Constructor Summary
SearchResults(List issuesInPage, int totalIssueCount, PagerFilter pagerFilter)
          Construct searchResults using the issues that should be displayed, and the 'total' number of issues.
SearchResults(List issues, PagerFilter pagerFilter)
          Construct searchResults using a list of issues.
 
Method Summary
protected  List generatePages()
          generates a collection of page objects which keep track of the pages for display
 int getEnd()
           
 List getIssues()
          Get the issues available in this page.
 int getNextStart()
           
 int getNiceStart()
          Return the 'readable' start (ie 1 instead of 0)
 List getPages()
           
 int getPreviousStart()
           
 int getStart()
           
 int getTotal()
           
protected  List restrictPages(Collection pages, int size)
          Restrict the pagers to a certain number of pages on either side of the current page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pages

protected Collection pages
A collection of SearchResults.Page objects

Constructor Detail

SearchResults

public SearchResults(List issues,
                     PagerFilter pagerFilter)
Construct searchResults using a list of issues. The issues returned by getIssues() will be a subset of the issues passed in.

Parameters:
issues - A list of Issue objects
pagerFilter - Representing which issues to limit the results to

SearchResults

public SearchResults(List issuesInPage,
                     int totalIssueCount,
                     PagerFilter pagerFilter)
Construct searchResults using the issues that should be displayed, and the 'total' number of issues. This is used when a search does not wish to load the entire list of issues into memory.

Parameters:
issuesInPage - A list of Issue objects
totalIssueCount - The count of the number of issues returned
pagerFilter - Representing the users preference for paging
Method Detail

getIssues

public List getIssues()
Get the issues available in this page.

Returns:
A list of Issue objects

getStart

public int getStart()
Specified by:
getStart in interface IssuePager

getEnd

public int getEnd()
Specified by:
getEnd in interface IssuePager

getTotal

public int getTotal()
Specified by:
getTotal in interface IssuePager

getNextStart

public int getNextStart()
Specified by:
getNextStart in interface IssuePager

getPreviousStart

public int getPreviousStart()
Specified by:
getPreviousStart in interface IssuePager

getNiceStart

public int getNiceStart()
Return the 'readable' start (ie 1 instead of 0)


getPages

public List getPages()
Specified by:
getPages in interface IssuePager

generatePages

protected List generatePages()
generates a collection of page objects which keep track of the pages for display


restrictPages

protected List restrictPages(Collection pages,
                             int size)
Restrict the pagers to a certain number of pages on either side of the current page.

The number of pages to list is stored in #PAGES_TO_LIST.



Copyright © 2002-2006 Atlassian. All Rights Reserved.