class Paginator implements Serializable, CloneableObject<Paginator> {

    public int setItemsPerPage(int itemsPerPage) {
        int tmp = this.itemsPerPage;

        this.itemsPerPage = itemsPerPage > 0 ? itemsPerPage : DEFAULT_ITEMS_PER_PAGE;

        if (page > 0) {
            setPage((int) ((double) (page - 1) * tmp / this.itemsPerPage) + 1);
        }

        return this.itemsPerPage;
    }

    public  Paginator();
    public  Paginator(int itemsPerPage);
    public  Paginator(int itemsPerPage, int items);
    public  Paginator(PageSize pageSize);
    public  Paginator(PageSize pageSize, int items);

}