All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sfm.poi.impl.RowEnumarable Maven / Gradle / Ivy

package org.sfm.poi.impl;

import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.sfm.utils.Enumarable;

public class RowEnumarable implements Enumarable {


    private int currentRowIndex;
    private final Sheet sheet;

    public RowEnumarable(int startRow, Sheet sheet) {
        this.currentRowIndex = startRow - 1;
        this.sheet = sheet;
    }

    @Override
    public boolean next() {
        if (currentRowIndex < sheet.getLastRowNum()) {
            currentRowIndex ++;
            return true;
        } else {
            return false;
        }
    }

    @Override
    public Row currentValue() {
        return sheet.getRow(currentRowIndex);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy