Class AbstractPaginator<E>

    • Field Detail

      • PARAMETER_PAGE_INDEX

        public static final java.lang.String PARAMETER_PAGE_INDEX
        Default value for Page Index Parameter
        See Also:
        Constant Field Values
      • PARAMETER_ITEMS_PER_PAGE

        public static final java.lang.String PARAMETER_ITEMS_PER_PAGE
        Default value for Items Per Page Parameter
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractPaginator

        public AbstractPaginator()
    • Method Detail

      • getPageCurrent

        public int getPageCurrent()
        Returns the current page index
        Specified by:
        getPageCurrent in interface IPaginator<E>
        Returns:
        The current page index
      • getFirstPageLink

        public java.lang.String getFirstPageLink()
        Returns the previous page link
        Specified by:
        getFirstPageLink in interface IPaginator<E>
        Returns:
        The previous page link
      • getPreviousPageLink

        public java.lang.String getPreviousPageLink()
        Returns the previous page link
        Specified by:
        getPreviousPageLink in interface IPaginator<E>
        Returns:
        The previous page link
      • getLastPageLink

        public java.lang.String getLastPageLink()
        Returns the previous page link
        Specified by:
        getLastPageLink in interface IPaginator<E>
        Returns:
        The previous page link
      • getItemsPerPage

        public int getItemsPerPage()
        Gets the items count per page.
        Specified by:
        getItemsPerPage in interface IPaginator<E>
        Returns:
        items count per page.
      • getNextPageLink

        public java.lang.String getNextPageLink()
        Returns the previous page link
        Specified by:
        getNextPageLink in interface IPaginator<E>
        Returns:
        The previous page link
      • getLabelFirst

        public java.lang.String getLabelFirst()
        Get First label
        Specified by:
        getLabelFirst in interface IPaginator<E>
        Returns:
        The Label
      • getLabelPrevious

        public java.lang.String getLabelPrevious()
        Get Previous label
        Specified by:
        getLabelPrevious in interface IPaginator<E>
        Returns:
        The Label
      • getLabelNext

        public java.lang.String getLabelNext()
        Get Next label
        Specified by:
        getLabelNext in interface IPaginator<E>
        Returns:
        The Label
      • getLabelLast

        public java.lang.String getLabelLast()
        Get First label
        Specified by:
        getLabelLast in interface IPaginator<E>
        Returns:
        The Label
      • getLabelItemCount

        public java.lang.String getLabelItemCount()
        Get Item Count label
        Specified by:
        getLabelItemCount in interface IPaginator<E>
        Returns:
        The Label
      • getLabelItemCountPerPage

        public java.lang.String getLabelItemCountPerPage()
        Get Item Count per page label
        Specified by:
        getLabelItemCountPerPage in interface IPaginator<E>
        Returns:
        The Label
      • getItemsPerPageParameterName

        public java.lang.String getItemsPerPageParameterName()
        Get the parameter name of the items_per_page
        Specified by:
        getItemsPerPageParameterName in interface IPaginator<E>
        Returns:
        the parameter name
      • setItemsPerPageParameterName

        public void setItemsPerPageParameterName​(java.lang.String strItemsPerPageParameterName)
        Set the parameter name of the items_per_page
        Specified by:
        setItemsPerPageParameterName in interface IPaginator<E>
        Parameters:
        strItemsPerPageParameterName - the parameter name
      • getPagesCount

        public int getPagesCount()
        Gets the number of pages
        Specified by:
        getPagesCount in interface IPaginator<E>
        Returns:
        the number of pages
      • getRangeMin

        public int getRangeMin()
        Returns the index of the first item of the current page range
        Specified by:
        getRangeMin in interface IPaginator<E>
        Returns:
        The index of the first item of the current page range
      • getRangeMax

        public int getRangeMax()
        Returns the index of the last item of the current page range
        Specified by:
        getRangeMax in interface IPaginator<E>
        Returns:
        The index of the last item of the current page range
      • getItemsCount

        public int getItemsCount()
        Returns the number of items in the collection
        Specified by:
        getItemsCount in interface IPaginator<E>
        Returns:
        The number of items in the collection
      • getItemsPerPage

        public static int getItemsPerPage​(javax.servlet.http.HttpServletRequest request,
                                          java.lang.String strParameter,
                                          int nCurrent,
                                          int nDefault)
        Gets the number of items per page from a request parameter
        Parameters:
        request - The HTTP request
        strParameter - The request parameter name
        nCurrent - The current number of items
        nDefault - The default number of items
        Returns:
        The new number of items
      • getPageIndex

        public static java.lang.String getPageIndex​(javax.servlet.http.HttpServletRequest request,
                                                    java.lang.String strParameter,
                                                    java.lang.String strCurrentPageIndex)
        Gets the new page index from a request parameter
        Parameters:
        request - The HTTP request
        strParameter - The request parameter name
        strCurrentPageIndex - The current page index
        Returns:
        The new page index