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

org.sfm.poi.SheetMapper Maven / Gradle / Ivy

package org.sfm.poi;

import org.apache.poi.ss.usermodel.Sheet;
import org.sfm.utils.RowHandler;

import java.util.Iterator;
//IFJAVA8_START
import java.util.stream.Stream;
//IFJAVA8_END

public interface SheetMapper {

    /**
     *
     * @param sheet the sheet to map from
     * @return an iterator of mapped instance of T
     */
    Iterator iterator(Sheet sheet);

    /**
     *
     * @param startRow row index to start at
     * @param sheet the sheet to map from
     * @return an iterator of mapped instance of T
     */
    Iterator iterator(int startRow, Sheet sheet);

    /**
     *
     * @param sheet the sheet to map from
     * @param rowHandler the handler to call back
     * @param  the type of the handler
     * @return the handler
     */
    > RH forEach(Sheet sheet, RH rowHandler);

    /**
     *
     * @param startRow row index to start at
     * @param sheet the sheet to map from
     * @param rowHandler the handler to call back
     * @param  the type of the handler
     * @return the handler
     */
    > RH forEach(int startRow, Sheet sheet, RH rowHandler);


    /**
     *
     * @param sheet the sheet to map from
     * @return a stream on mapped instance of T
     */
    //IFJAVA8_START
    Stream stream(Sheet sheet);
    //IFJAVA8_END

    /**
     *
     * @param startRow row index to start at
     * @param sheet the sheet to map from
     * @return a stream on mapped instance of T
     */
    //IFJAVA8_START
    Stream stream(int startRow, Sheet sheet);
    //IFJAVA8_END
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy