org.jxls.common.SheetData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jxls-core Show documentation
Show all versions of jxls-core Show documentation
Small library for Excel generation based on XLS templates
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();
}
}