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

com.github.kunalk16.excel.model.factory.ExcelRow Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package com.github.kunalk16.excel.model.factory;

import com.github.kunalk16.excel.factory.extractor.ColumnNameByNumberExtractor;
import com.github.kunalk16.excel.model.user.Cell;
import com.github.kunalk16.excel.model.user.Row;

import java.util.Collection;
import java.util.Map;

public class ExcelRow implements Row {
    private final int rowNumber;

    private final Map cellByColumn;

    public ExcelRow(Map cellByColumn, int rowNumber) {
        this.cellByColumn = cellByColumn;
        this.rowNumber = rowNumber;
    }

    @Override
    public int getRow() {
        return this.rowNumber;
    }

    @Override
    public Collection getCells() {
        return this.cellByColumn.values();
    }

    @Override
    public Cell getCellByColumn(String column) {
        return this.cellByColumn.get(column);
    }

    @Override
    public Cell getCellByIndex(int index) {
        return this.getCellByColumn(ColumnNameByNumberExtractor.getInstance().apply(index));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy