fromIndex和toIndex的计算问题
//起始索引(列表中的数据从0开始)
int fromIndex = (this.paperCurrent-1)*this.paperSize;
//结束索引
int toIndex;
if(this.paperCurrent*this.paperCurrent>this.totalRecord){
toIndex = this.totalRecord;
}else{
toIndex = this.paperCurrent*this.paperSize;
}
起始列表应该是从0开始的吧,如果有10条记录的话,应该是0-9做为索引,如果每页5条,那么2*5=10,是否需要在计算结束索引时-1呢?求告知