⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page.java

📁 OA典型例子
💻 JAVA
字号:
// Decompiled by DJ v3.0.0.63 Copyright 2002 Atanas Neshkov  Date: 2002-8-3 14:31:20
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) fieldsfirst ansi nonlb
// Source File Name:   Page.java

package com.sure.businessmodel;

import java.util.*;

public class Page {

    private List _$2928;
    private int _$784;
    private int _$2929;
    private int _$2930;
    private static final int _$2931 = 1;

    public Page(int ps) {
        if(ps <= 0) {
            throw new RuntimeException("pageSize必须大于零。");
        } else {
            _$2928 = Collections.EMPTY_LIST;
            _$784 = 1;
            _$2929 = 0;
            _$2930 = ps;
            return;
        }
    }

    public Page(List l, int s, int t, int ps) {
        _$784 = getValidStart(s, t, ps);
        _$2928 = new Vector(l);
        _$2929 = t;
        _$2930 = ps;
    }

    public List getList() {
        return _$2928;
    }

    public boolean hasNextPage() {
        return (_$784 + _$2928.size()) - 1 < _$2929;
    }

    public boolean hasPreviousPage() {
        return _$784 > 1;
    }

    public int getStartOfNextPage() {
        return getValidStart(_$784 + _$2928.size(), _$2929, _$2930);
    }

    public int getStartOfPreviousPage() {
        return getValidStart(_$784 - _$2930, _$2929, _$2930);
    }

    public int getSize() {
        return _$2928.size();
    }

    public int getPageCount() {
        return (_$2929 - 1) / _$2930 + 1;
    }

    public int getPageNumber() {
        return (_$784 - 1) / _$2930 + 1;
    }

    public int getPageSize() {
        return _$2930;
    }

    public int getTotalRecords() {
        return _$2929;
    }

    public static int getValidStart(int s, int t, int ps) {
        if(ps <= 0)
            throw new RuntimeException("pageSize必须大于零。");
        if(t < 0)
            throw new RuntimeException("记录总数不能小于零。");
        if(s > t)
            return ((t - 1) / ps) * ps + 1;
        if(s < 1)
            return 1;
        else
            return s;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -