CavalliumDBEngine/src/main/java/it/cavallium/dbengine/lucene/SinglePageLimits.java

24 lines
426 B
Java
Raw Normal View History

package it.cavallium.dbengine.lucene;
2021-09-20 18:20:59 +02:00
public class SinglePageLimits implements PageLimits {
private final int firstPageLimit;
public SinglePageLimits() {
this(DEFAULT_MIN_ITEMS_PER_PAGE);
}
public SinglePageLimits(int firstPageLimit) {
this.firstPageLimit = firstPageLimit;
}
@Override
public int getPageLimit(int pageIndex) {
if (pageIndex == 0) {
return firstPageLimit;
} else {
return 0;
}
}
}