X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.excel.poi%2Fsrc%2Forg%2Fsimantics%2Fexcel%2Fpoi%2Fparser%2Fstreaming%2FRowImpl.java;fp=org.simantics.excel.poi%2Fsrc%2Forg%2Fsimantics%2Fexcel%2Fpoi%2Fparser%2Fstreaming%2FRowImpl.java;h=1ca2eb36b77b7e2ecd6a376cb2f5557a5cb750c4;hb=7abd05645636ea510269d77005717f43c2c445ba;hp=0000000000000000000000000000000000000000;hpb=f11cbe76b3f4be142c9f84ef9a7b6bc9dcc8ff23;p=simantics%2Finterop.git diff --git a/org.simantics.excel.poi/src/org/simantics/excel/poi/parser/streaming/RowImpl.java b/org.simantics.excel.poi/src/org/simantics/excel/poi/parser/streaming/RowImpl.java new file mode 100644 index 0000000..1ca2eb3 --- /dev/null +++ b/org.simantics.excel.poi/src/org/simantics/excel/poi/parser/streaming/RowImpl.java @@ -0,0 +1,166 @@ +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; + } + +}