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

io.github.sinri.keel.poi.excel.entity.KeelSheetTemplatedMatrixImpl Maven / Gradle / Ivy

Go to download

A website framework with VERT.X for ex-PHP-ers, exactly Ark Framework Users.

The newest version!
package io.github.sinri.keel.poi.excel.entity;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

/**
 * @since 3.0.13
 * @since 3.0.18 Finished Technical Preview.
 */
public class KeelSheetTemplatedMatrixImpl implements KeelSheetTemplatedMatrix {
    private final KeelSheetMatrixRowTemplate template;
    private final List> rawRows;
    //private final List templatedRows;

    KeelSheetTemplatedMatrixImpl(@Nonnull KeelSheetMatrixRowTemplate template) {
        this.template = template;
        this.rawRows = new ArrayList<>();
//        this.templatedRows = new ArrayList<>();
    }

    @Override
    public List> getRawRows() {
        return rawRows;
    }

    @Override
    public KeelSheetMatrixRowTemplate getTemplate() {
        return template;
    }

    @Override
    public KeelSheetMatrixTemplatedRow getRow(int index) {
        return KeelSheetMatrixTemplatedRow.create(getTemplate(), this.rawRows.get(index));
//        return this.templatedRows.get(index);
    }

    @Override
    public List getRows() {
        List templatedRows = new ArrayList<>();
        this.rawRows.forEach(rawRow -> {
            templatedRows.add(KeelSheetMatrixTemplatedRow.create(getTemplate(), rawRow));
        });
        return templatedRows;
    }

    @Override
    public KeelSheetTemplatedMatrix addRawRow(@Nonnull List rawRow) {
        this.rawRows.add(rawRow);
        //this.templatedRows.add(KeelSheetMatrixTemplatedRow.create(getTemplate(), rawRow));
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy