2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.remote
.dto
;
12 import java
.util
.ArrayList
;
13 import java
.util
.List
;
16 * Instances of this class represent page based subsets of the total set of results returned by a search query.
18 * @author a.kohlbecker
20 * @created 15.02.2008 15:26:06
23 public class ResultSetPageSTO
<T
extends BaseSTO
> {
26 * Total number of matching records. Maybe distributed across several pages
28 private long totalResultsCount
;
30 * Total number of pages
32 private int totalPageCount
;
34 * Then number of items per page. Defaults to 25
36 private int pageSize
= 25;
38 * The number of this page. First default page has index 1.
40 private int pageNumber
= 1;
42 * The number of records on this page
44 private int resultsOnPage
;
46 * A list containing the items for this result page.
47 * The number of items will not exceed the {@link #pageSize} value.
48 * The last page may contain less items.
50 private List
<T
> results
= new ArrayList
<T
>();
53 public long getTotalResultsCount() {
54 return totalResultsCount
;
56 public void setTotalResultsCount(long totalResultsCount
) {
57 this.totalResultsCount
= totalResultsCount
;
58 this.totalPageCount
= (int) Math
.ceil(totalResultsCount
/ pageSize
);
60 public int getPageSize() {
63 public void setPageSize(int pageSize
) {
64 this.pageSize
= pageSize
;
66 public int getPageNumber() {
69 public void setPageNumber(int pageNumber
) {
70 this.pageNumber
= pageNumber
;
71 this.resultsOnPage
= (int) (totalResultsCount
-(pageNumber
-1)*pageSize
);
73 public int getTotalPageCount() {
74 return totalPageCount
;
76 public List
<T
> getResults() {
79 public int getResultsOnPage() {