package org.simantics.excel.poi.parser.streaming; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; public class RowImpl implements Row { SheetImpl sheetImpl; List cellData; List cellTypes; List cells; int index; public RowImpl(SheetImpl sheetImpl, List cellData, List cellTypes, int index) { this.sheetImpl = sheetImpl; this.cellData = cellData; this.cellTypes = cellTypes; this.cells = new ArrayList(cellData.size()); for (int i = 0; i < cellData.size(); i++) { cells.add(new CellImpl(this, i)); } this.index = index; } @Override public Iterator cellIterator() { return cells.iterator(); } @Override public Cell createCell(int column) { return null; } @Override public Cell createCell(int column, int type) { return null; } @Override public Cell getCell(int cellnum) { return cells.get(cellnum); } @Override public Cell getCell(int cellnum, MissingCellPolicy policy) { return cells.get(cellnum); } @Override public short getFirstCellNum() { return 0; } @Override public short getLastCellNum() { return (short)(cells.size()-1); } @Override public short getHeight() { return 0; } @Override public float getHeightInPoints() { return 0; } @Override public int getPhysicalNumberOfCells() { return cells.size(); } @Override public int getRowNum() { return index; } @Override public CellStyle getRowStyle() { return null; } @Override public Sheet getSheet() { return sheetImpl; } @Override public boolean getZeroHeight() { return false; } @Override public boolean isFormatted() { return false; } @Override public Iterator iterator() { return cells.iterator(); } @Override public void removeCell(Cell cell) { } @Override public void setHeight(short height) { } @Override public void setHeightInPoints(float height) { } @Override public void setRowNum(int rowNum) { } @Override public void setRowStyle(CellStyle style) { } @Override public void setZeroHeight(boolean zHeight) { } @Override public int getOutlineLevel() { return 0; } @Override public Cell createCell(int arg0, CellType arg1) { throw new UnsupportedOperationException(); } @Override public String toString() { String s = ""; for (int i = 0; i < cellData.size(); i++) { s += cellTypes.get(i)+":" + cellData.get(i) + "; "; } return s; } }