1 package org.simantics.excel.poi.parser.streaming;
\r
3 import java.util.ArrayList;
\r
4 import java.util.Iterator;
\r
5 import java.util.List;
\r
7 import org.apache.poi.ss.usermodel.Cell;
\r
8 import org.apache.poi.ss.usermodel.CellStyle;
\r
9 import org.apache.poi.ss.usermodel.CellType;
\r
10 import org.apache.poi.ss.usermodel.Row;
\r
11 import org.apache.poi.ss.usermodel.Sheet;
\r
13 public class RowImpl implements Row {
\r
14 SheetImpl sheetImpl;
\r
16 List<String> cellData;
\r
17 List<String> cellTypes;
\r
22 public RowImpl(SheetImpl sheetImpl, List<String> cellData, List<String> cellTypes, int index) {
\r
23 this.sheetImpl = sheetImpl;
\r
24 this.cellData = cellData;
\r
25 this.cellTypes = cellTypes;
\r
26 this.cells = new ArrayList<Cell>(cellData.size());
\r
27 for (int i = 0; i < cellData.size(); i++) {
\r
28 cells.add(new CellImpl(this, i));
\r
34 public Iterator<Cell> cellIterator() {
\r
35 return cells.iterator();
\r
39 public Cell createCell(int column) {
\r
44 public Cell createCell(int column, int type) {
\r
49 public Cell getCell(int cellnum) {
\r
50 return cells.get(cellnum);
\r
54 public Cell getCell(int cellnum, MissingCellPolicy policy) {
\r
55 return cells.get(cellnum);
\r
59 public short getFirstCellNum() {
\r
64 public short getLastCellNum() {
\r
65 return (short)(cells.size()-1);
\r
70 public short getHeight() {
\r
75 public float getHeightInPoints() {
\r
81 public int getPhysicalNumberOfCells() {
\r
82 return cells.size();
\r
86 public int getRowNum() {
\r
91 public CellStyle getRowStyle() {
\r
96 public Sheet getSheet() {
\r
101 public boolean getZeroHeight() {
\r
106 public boolean isFormatted() {
\r
111 public Iterator<Cell> iterator() {
\r
112 return cells.iterator();
\r
116 public void removeCell(Cell cell) {
\r
121 public void setHeight(short height) {
\r
126 public void setHeightInPoints(float height) {
\r
131 public void setRowNum(int rowNum) {
\r
136 public void setRowStyle(CellStyle style) {
\r
141 public void setZeroHeight(boolean zHeight) {
\r
146 public int getOutlineLevel() {
\r
151 public Cell createCell(int arg0, CellType arg1) {
\r
152 throw new UnsupportedOperationException();
\r
158 public String toString() {
\r
160 for (int i = 0; i < cellData.size(); i++) {
\r
161 s += cellTypes.get(i)+":" + cellData.get(i) + "; ";
\r