Skip to content

Commit 6e8b2ef

Browse files
committed
fixes several issues for 0.2.1 release
1 parent f72eff5 commit 6e8b2ef

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

pom.xml

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.thundermoose</groupId>
77
<artifactId>xlsx-streamer</artifactId>
8-
<version>0.3-SNAPSHOT</version>
8+
<version>0.2.1</version>
99

1010
<build>
1111
<plugins>
@@ -23,6 +23,19 @@
2323
<artifactId>maven-install-plugin</artifactId>
2424
<version>2.5.1</version>
2525
</plugin>
26+
<plugin>
27+
<groupId>org.apache.maven.plugins</groupId>
28+
<artifactId>maven-source-plugin</artifactId>
29+
<version>2.2.1</version>
30+
<executions>
31+
<execution>
32+
<id>attach-sources</id>
33+
<goals>
34+
<goal>jar</goal>
35+
</goals>
36+
</execution>
37+
</executions>
38+
</plugin>
2639
</plugins>
2740
</build>
2841

src/main/java/com/thundermoose/xlsx/StreamingReader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private void handleEvent(XMLEvent event) throws SAXException {
127127

128128
if (endElement.getName().getLocalPart().equals("v")) {
129129
currentCell.setContents(lastContents);
130-
currentRow.getCellList().add(currentCell);
130+
currentRow.getCellMap().put(currentCell.getColumnIndex(), currentCell);
131131
}
132132

133133
}

src/main/java/com/thundermoose/xlsx/impl/StreamingRow.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@
77
import org.apache.poi.ss.usermodel.Sheet;
88

99
import java.util.Iterator;
10-
import java.util.LinkedList;
11-
import java.util.List;
10+
import java.util.Map;
11+
import java.util.TreeMap;
1212

1313
public class StreamingRow implements Row {
1414
private int rowIndex;
15-
private List<Cell> cellList = new LinkedList<Cell>();
15+
private Map<Integer, Cell> cellMap = new TreeMap<>();
1616

1717
public StreamingRow(int rowIndex) {
1818
this.rowIndex = rowIndex;
1919
}
2020

21-
public List<Cell> getCellList() {
22-
return cellList;
21+
public Map<Integer, Cell> getCellMap() {
22+
return cellMap;
2323
}
2424

25-
public void setCellList(List<Cell> cellList) {
26-
this.cellList = cellList;
25+
public void setCellMap(Map<Integer, Cell> cellMap) {
26+
this.cellMap = cellMap;
2727
}
2828

29-
/* Supported */
29+
/* Supported */
3030

3131
@Override
3232
public int getRowNum() {
@@ -35,17 +35,17 @@ public int getRowNum() {
3535

3636
@Override
3737
public Iterator<Cell> cellIterator() {
38-
return cellList.iterator();
38+
return cellMap.values().iterator();
3939
}
4040

4141
@Override
4242
public Iterator<Cell> iterator() {
43-
return cellList.iterator();
43+
return cellMap.values().iterator();
4444
}
4545

4646
@Override
4747
public Cell getCell(int cellnum) {
48-
return cellList.size() > cellnum ? cellList.get(cellnum) : null;
48+
return cellMap.get(cellnum);
4949
}
5050

5151
/* Not supported */

0 commit comments

Comments
 (0)