001: /*
002: * Copyright 2004 Clinton Begin
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package com.ibatis.common.util;
017:
018: import java.util.List;
019:
020: /**
021: * Interface for lists that support paging
022: * @deprecated All paginated list features have been deprecated
023: */
024: public interface PaginatedList extends List {
025:
026: /**
027: * Returns the maximum number of items per page
028: *
029: * @return The maximum number of items per page.
030: */
031: public int getPageSize();
032:
033: /**
034: * Is the current page the first page?
035: *
036: * @return True if the current page is the first page or if only
037: * a single page exists.
038: */
039: public boolean isFirstPage();
040:
041: /**
042: * Is the current page a middle page (ie not first or last)?
043: *
044: * @return True if the current page is not the first or last page,
045: * and more than one page exists (always returns false if only a
046: * single page exists).
047: */
048: public boolean isMiddlePage();
049:
050: /**
051: * Is the current page the last page?
052: *
053: * @return True if the current page is the last page or if only
054: * a single page exists.
055: */
056: public boolean isLastPage();
057:
058: /**
059: * Is a page available after the current page?
060: *
061: * @return True if the next page is available
062: */
063: public boolean isNextPageAvailable();
064:
065: /**
066: * Is a page available before the current page?
067: *
068: * @return True if the previous page is available
069: */
070: public boolean isPreviousPageAvailable();
071:
072: /**
073: * Moves to the next page after the current page. If the current
074: * page is the last page, wrap to the first page.
075: *
076: * @return True if the page changed
077: */
078: public boolean nextPage();
079:
080: /**
081: * Moves to the page before the current page. If the current
082: * page is the first page, wrap to the last page.
083: *
084: * @return True if the page changed
085: */
086: public boolean previousPage();
087:
088: /**
089: * Moves to a specified page. If the specified
090: * page is beyond the last page, wrap to the first page.
091: * If the specified page is before the first page, wrap
092: * to the last page.
093: *
094: * @param pageNumber The page to go to
095: */
096: public void gotoPage(int pageNumber);
097:
098: /**
099: * Returns the current page index, which is a zero based integer.
100: * All paginated list implementations should know what index they are
101: * on, even if they don't know the ultimate boundaries (min/max).
102: *
103: * @return The current page
104: */
105: public int getPageIndex();
106:
107: }
|