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

org.jxls.common.SheetData Maven / Gradle / Ivy

The newest version!
package org.jxls.common;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.jxls.transform.Transformer;

/**
 * Represents an Excel sheet data holder
 * 
 * @author Leonid Vysochyn
 */
public class SheetData implements Iterable {
    protected String sheetName;
    protected int[] columnWidth;
    protected final List rowDataList = new ArrayList();
    private Transformer transformer;

    public Transformer getTransformer() {
        return transformer;
    }

    public void setTransformer(Transformer transformer) {
        this.transformer = transformer;
    }

    public int getNumberOfRows() {
        return rowDataList.size();
    }

    public String getSheetName() {
        return sheetName;
    }

    public int getColumnWidth(int col) {
        return columnWidth[col];
    }

    public RowData getRowData(int row) {
        if (row < rowDataList.size()) {
            return rowDataList.get(row);
        } else {
            return null;
        }
    }

    public void addRowData(RowData rowData) {
        rowDataList.add(rowData);
    }

    @Override
    public Iterator iterator() {
        return rowDataList.iterator();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy