mirror of https://github.com/apache/poi.git
code formatting
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835674 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8991d83868
commit
ee1e389838
|
@ -66,7 +66,7 @@ public class SXSSFSheet implements Sheet
|
||||||
{
|
{
|
||||||
/*package*/ final XSSFSheet _sh;
|
/*package*/ final XSSFSheet _sh;
|
||||||
private final SXSSFWorkbook _workbook;
|
private final SXSSFWorkbook _workbook;
|
||||||
private final TreeMap<Integer,SXSSFRow> _rows= new TreeMap<>();
|
private final TreeMap<Integer,SXSSFRow> _rows = new TreeMap<>();
|
||||||
private final SheetDataWriter _writer;
|
private final SheetDataWriter _writer;
|
||||||
private int _randomAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE;
|
private int _randomAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE;
|
||||||
private final AutoSizeColumnTracker _autoSizeColumnTracker;
|
private final AutoSizeColumnTracker _autoSizeColumnTracker;
|
||||||
|
@ -138,17 +138,13 @@ public class SXSSFSheet implements Sheet
|
||||||
"in the range [0," + _sh.getLastRowNum() + "] that is already written to disk.");
|
"in the range [0," + _sh.getLastRowNum() + "] that is already written to disk.");
|
||||||
}
|
}
|
||||||
|
|
||||||
SXSSFRow newRow=new SXSSFRow(this);
|
SXSSFRow newRow = new SXSSFRow(this);
|
||||||
_rows.put(rownum,newRow);
|
_rows.put(rownum, newRow);
|
||||||
allFlushed = false;
|
allFlushed = false;
|
||||||
if(_randomAccessWindowSize>=0&&_rows.size()>_randomAccessWindowSize)
|
if(_randomAccessWindowSize >= 0 && _rows.size() > _randomAccessWindowSize) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
flushRows(_randomAccessWindowSize);
|
flushRows(_randomAccessWindowSize);
|
||||||
}
|
} catch (IOException ioe) {
|
||||||
catch (IOException ioe)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(ioe);
|
throw new RuntimeException(ioe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,11 +163,9 @@ public class SXSSFSheet implements Sheet
|
||||||
throw new IllegalArgumentException("Specified row does not belong to this sheet");
|
throw new IllegalArgumentException("Specified row does not belong to this sheet");
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Iterator<Map.Entry<Integer,SXSSFRow>> iter=_rows.entrySet().iterator();iter.hasNext();)
|
for(Iterator<Map.Entry<Integer, SXSSFRow>> iter = _rows.entrySet().iterator(); iter.hasNext();) {
|
||||||
{
|
Map.Entry<Integer, SXSSFRow> entry = iter.next();
|
||||||
Map.Entry<Integer,SXSSFRow> entry=iter.next();
|
if(entry.getValue() == row) {
|
||||||
if(entry.getValue()==row)
|
|
||||||
{
|
|
||||||
iter.remove();
|
iter.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -199,7 +193,7 @@ public class SXSSFSheet implements Sheet
|
||||||
@Override
|
@Override
|
||||||
public int getPhysicalNumberOfRows()
|
public int getPhysicalNumberOfRows()
|
||||||
{
|
{
|
||||||
return _rows.size()+_writer.getNumberOfFlushedRows();
|
return _rows.size() + _writer.getNumberOfFlushedRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -208,8 +202,7 @@ public class SXSSFSheet implements Sheet
|
||||||
* @return the number of the first logical row on the sheet (0-based)
|
* @return the number of the first logical row on the sheet (0-based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getFirstRowNum()
|
public int getFirstRowNum() {
|
||||||
{
|
|
||||||
if(_writer.getNumberOfFlushedRows() > 0) {
|
if(_writer.getNumberOfFlushedRows() > 0) {
|
||||||
return _writer.getLowestIndexOfFlushedRows();
|
return _writer.getLowestIndexOfFlushedRows();
|
||||||
}
|
}
|
||||||
|
@ -971,7 +964,7 @@ public class SXSSFSheet implements Sheet
|
||||||
@NotImplemented
|
@NotImplemented
|
||||||
@Override
|
@Override
|
||||||
public void shiftRows(int startRow, int endRow, int n) {
|
public void shiftRows(int startRow, int endRow, int n) {
|
||||||
throw new RuntimeException("NotImplemented");
|
throw new RuntimeException("Not Implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -996,7 +989,7 @@ public class SXSSFSheet implements Sheet
|
||||||
@Override
|
@Override
|
||||||
public void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
|
public void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
|
||||||
{
|
{
|
||||||
throw new RuntimeException("NotImplemented");
|
throw new RuntimeException("Not Implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1734,7 +1727,7 @@ public class SXSSFSheet implements Sheet
|
||||||
// corrupted .xlsx files as rows appear multiple times in the resulting sheetX.xml files
|
// corrupted .xlsx files as rows appear multiple times in the resulting sheetX.xml files
|
||||||
// return _sh.setArrayFormula(formula, range);
|
// return _sh.setArrayFormula(formula, range);
|
||||||
|
|
||||||
throw new RuntimeException("NotImplemented");
|
throw new RuntimeException("Not Implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1749,7 +1742,7 @@ public class SXSSFSheet implements Sheet
|
||||||
// corrupted .xlsx files as rows appear multiple times in the resulting sheetX.xml files
|
// corrupted .xlsx files as rows appear multiple times in the resulting sheetX.xml files
|
||||||
// return _sh.removeArrayFormula(cell);
|
// return _sh.removeArrayFormula(cell);
|
||||||
|
|
||||||
throw new RuntimeException("NotImplemented");
|
throw new RuntimeException("Not Implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1831,7 +1824,7 @@ public class SXSSFSheet implements Sheet
|
||||||
if(value == 0 || value < -1) {
|
if(value == 0 || value < -1) {
|
||||||
throw new IllegalArgumentException("RandomAccessWindowSize must be either -1 or a positive integer");
|
throw new IllegalArgumentException("RandomAccessWindowSize must be either -1 or a positive integer");
|
||||||
}
|
}
|
||||||
_randomAccessWindowSize=value;
|
_randomAccessWindowSize = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2123,6 +2116,6 @@ public class SXSSFSheet implements Sheet
|
||||||
@NotImplemented
|
@NotImplemented
|
||||||
@Override
|
@Override
|
||||||
public void shiftColumns(int startColumn, int endColumn, int n){
|
public void shiftColumns(int startColumn, int endColumn, int n){
|
||||||
throw new UnsupportedOperationException("NotImplemented");
|
throw new UnsupportedOperationException("Not Implemented");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -691,9 +691,8 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@NotImplemented
|
@NotImplemented
|
||||||
public Sheet cloneSheet(int sheetNum)
|
public Sheet cloneSheet(int sheetNum) {
|
||||||
{
|
throw new RuntimeException("Not Implemented");
|
||||||
throw new RuntimeException("NotImplemented");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1291,7 +1290,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
@Override
|
@Override
|
||||||
@NotImplemented
|
@NotImplemented
|
||||||
public int linkExternalWorkbook(String name, Workbook workbook) {
|
public int linkExternalWorkbook(String name, Workbook workbook) {
|
||||||
throw new RuntimeException("NotImplemented");
|
throw new RuntimeException("Not Implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -59,7 +59,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
|
||||||
@Test
|
@Test
|
||||||
public void cloneSheet() throws IOException {
|
public void cloneSheet() throws IOException {
|
||||||
thrown.expect(RuntimeException.class);
|
thrown.expect(RuntimeException.class);
|
||||||
thrown.expectMessage("NotImplemented");
|
thrown.expectMessage("Not Implemented");
|
||||||
super.cloneSheet();
|
super.cloneSheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
|
||||||
@Test
|
@Test
|
||||||
public void cloneSheetMultipleTimes() throws IOException {
|
public void cloneSheetMultipleTimes() throws IOException {
|
||||||
thrown.expect(RuntimeException.class);
|
thrown.expect(RuntimeException.class);
|
||||||
thrown.expectMessage("NotImplemented");
|
thrown.expectMessage("Not Implemented");
|
||||||
super.cloneSheetMultipleTimes();
|
super.cloneSheetMultipleTimes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
|
||||||
@Test
|
@Test
|
||||||
public void shiftMerged() throws IOException {
|
public void shiftMerged() throws IOException {
|
||||||
thrown.expect(RuntimeException.class);
|
thrown.expect(RuntimeException.class);
|
||||||
thrown.expectMessage("NotImplemented");
|
thrown.expectMessage("Not Implemented");
|
||||||
super.shiftMerged();
|
super.shiftMerged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
|
||||||
@Test
|
@Test
|
||||||
public void bug35084() throws IOException {
|
public void bug35084() throws IOException {
|
||||||
thrown.expect(RuntimeException.class);
|
thrown.expect(RuntimeException.class);
|
||||||
thrown.expectMessage("NotImplemented");
|
thrown.expectMessage("Not Implemented");
|
||||||
super.bug35084();
|
super.bug35084();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
|
||||||
super.cloneSheet();
|
super.cloneSheet();
|
||||||
fail("expected exception");
|
fail("expected exception");
|
||||||
} catch (RuntimeException e){
|
} catch (RuntimeException e){
|
||||||
assertEquals("NotImplemented", e.getMessage());
|
assertEquals("Not Implemented", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
|
||||||
super.sheetClone();
|
super.sheetClone();
|
||||||
fail("expected exception");
|
fail("expected exception");
|
||||||
} catch (RuntimeException e){
|
} catch (RuntimeException e){
|
||||||
assertEquals("NotImplemented", e.getMessage());
|
assertEquals("Not Implemented", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue