001/* 002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * matic 011 */ 012package org.nuxeo.ecm.automation.client.model; 013 014import java.util.List; 015 016/** 017 * @author matic 018 */ 019public class PaginableDocuments extends Documents { 020 021 private static final long serialVersionUID = 1L; 022 023 /** 024 * @deprecated since 5.7.3. Use {@link #resultsCount}. 025 */ 026 @Deprecated 027 protected int totalSize; 028 029 /** 030 * @deprecated since 5.7.3. Use {@link #numberOfPages}. 031 */ 032 @Deprecated 033 protected int pageCount; 034 035 /** 036 * @deprecated since 5.7.3. Use {@link #currentPageIndex}. 037 */ 038 @Deprecated 039 protected int pageIndex; 040 041 protected int pageSize; 042 043 protected int currentPageIndex; 044 045 protected int numberOfPages; 046 047 protected int resultsCount; 048 049 public PaginableDocuments() { 050 } 051 052 /** 053 * @param size 054 */ 055 public PaginableDocuments(List<Document> docs, int resultsCount, int pageSize, int numberOfPages, 056 int currentPageIndex) { 057 super(docs); 058 this.resultsCount = resultsCount; 059 this.pageSize = pageSize; 060 this.numberOfPages = numberOfPages; 061 this.currentPageIndex = currentPageIndex; 062 } 063 064 /** 065 * @deprecated since 5.7.3. Use {@link #getResultsCount()}. 066 */ 067 @Deprecated 068 public int getTotalSize() { 069 return getResultsCount(); 070 } 071 072 /** 073 * @deprecated since 5.7.3. Use {@link #getNumberOfPages()}. 074 */ 075 @Deprecated 076 public int getPageCount() { 077 return getNumberOfPages(); 078 } 079 080 /** 081 * @deprecated since 5.7.3. Use {@link #getCurrentPageIndex()}. 082 */ 083 @Deprecated 084 public int getPageIndex() { 085 return getCurrentPageIndex(); 086 } 087 088 /** 089 * @deprecated since 5.7.3. Use {@link #setResultsCount(int)}. 090 */ 091 @Deprecated 092 public void setTotalSize(int totalSize) { 093 setResultsCount(totalSize); 094 } 095 096 /** 097 * @deprecated since 5.7.3. Use {@link #setNumberOfPages(int)}. 098 */ 099 @Deprecated 100 public void setPageCount(int pageCount) { 101 setNumberOfPages(pageCount); 102 } 103 104 /** 105 * @deprecated since 5.7.3. Use {@link #setCurrentPageIndex(int)}. 106 */ 107 @Deprecated 108 public void setPageIndex(int pageIndex) { 109 setCurrentPageIndex(pageIndex); 110 } 111 112 public int getPageSize() { 113 return pageSize; 114 } 115 116 public void setPageSize(int pageSize) { 117 this.pageSize = pageSize; 118 } 119 120 public int getCurrentPageIndex() { 121 return currentPageIndex; 122 } 123 124 public void setCurrentPageIndex(int currentPageIndex) { 125 this.currentPageIndex = currentPageIndex; 126 } 127 128 public int getNumberOfPages() { 129 return numberOfPages; 130 } 131 132 public void setNumberOfPages(int numberOfPages) { 133 this.numberOfPages = numberOfPages; 134 } 135 136 public int getResultsCount() { 137 return resultsCount; 138 } 139 140 public void setResultsCount(int resultsCount) { 141 this.resultsCount = resultsCount; 142 } 143}