<commit_before>package systems.rcd.fwk.poi.xls.impl.data;

import java.util.ArrayList;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;

import systems.rcd.fwk.core.format.xls.data.RcdXlsCell;
import systems.rcd.fwk.core.format.xls.data.RcdXlsRow;

public class RcdPoiXlsRow extends ArrayList<RcdXlsCell> implements RcdXlsRow {

    public RcdPoiXlsRow(final Row row) {
        super(row.getLastCellNum());
        for (int i = 0; i < row.getLastCellNum(); i++) {
            final Cell cell = row.getCell(i, Row.RETURN_BLANK_AS_NULL);
            if (cell == null || cell.getCellType() == Cell.CELL_TYPE_ERROR) {
                add(null);
            } else {
                RcdPoiXlsCell xlsCell = null;
                try {
                    xlsCell = new RcdPoiXlsCell(cell);
                } catch (final Exception e) {
                }
                add(xlsCell);
            }
        }
    }
}<commit_msg>GetValue from XlsRow<commit_after>package systems.rcd.fwk.poi.xls.impl.data;

import java.time.Instant;
import java.util.ArrayList;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;

import systems.rcd.fwk.core.format.xls.data.RcdXlsCell;
import systems.rcd.fwk.core.format.xls.data.RcdXlsRow;

public class RcdPoiXlsRow extends ArrayList<RcdXlsCell> implements RcdXlsRow {

    public RcdPoiXlsRow(final Row row) {
        super(row.getLastCellNum());
        for (int i = 0; i < row.getLastCellNum(); i++) {
            final Cell cell = row.getCell(i, Row.RETURN_BLANK_AS_NULL);
            if (cell == null || cell.getCellType() == Cell.CELL_TYPE_ERROR) {
                add(null);
            } else {
                RcdPoiXlsCell xlsCell = null;
                try {
                    xlsCell = new RcdPoiXlsCell(cell);
                } catch (final Exception e) {
                }
                add(xlsCell);
            }
        }
    }

    @Override
    public String getString(final int index) {
        final RcdXlsCell cell = get(index);
        return cell == null ? null : cell.getStringValue();
    };

    @Override
    public Instant getInstant(final int index) {
        final RcdXlsCell cell = get(index);
        return cell == null ? null : cell.getInstantValue();
    }

    @Override
    public Double getNumber(final int index) {
        final RcdXlsCell cell = get(index);
        return cell == null ? null : cell.getNumericValue();
    }

    @Override
    public Boolean getBoolean(final int index) {
        final RcdXlsCell cell = get(index);
        return cell == null ? null : cell.getBooleanValue();
    }

    @Override
    public RcdXlsCell get(final int index) {
        return size() > index ? super.get(index) : null;
    }
}
{'fraction_non_alphanumeric': 0.11006517016654598, 'fraction_numerical': 0.000724112961622013, 'mean_word_length': 2.143344709897611, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6541025', 'n_tokens_mistral': 926, 'n_tokens_neox': 896, 'n_words': 185}