mirror of https://github.com/apache/poi.git
Use interfaces for variables and reformat source-code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911436 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ee1c914cea
commit
acf61f325f
|
@ -24,6 +24,8 @@ import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.io.Reader;
|
||||||
|
import java.io.Writer;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -141,7 +143,8 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
/**
|
/**
|
||||||
* Construct a new workbook with default row window size
|
* Construct a new workbook with default row window size
|
||||||
*/
|
*/
|
||||||
public SXSSFWorkbook(){
|
public SXSSFWorkbook()
|
||||||
|
{
|
||||||
this(null /*workbook*/);
|
this(null /*workbook*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +183,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
*
|
*
|
||||||
* @param workbook the template workbook
|
* @param workbook the template workbook
|
||||||
*/
|
*/
|
||||||
public SXSSFWorkbook(XSSFWorkbook workbook){
|
public SXSSFWorkbook(XSSFWorkbook workbook) {
|
||||||
this(workbook, DEFAULT_WINDOW_SIZE);
|
this(workbook, DEFAULT_WINDOW_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +208,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
*
|
*
|
||||||
* @param rowAccessWindowSize the number of rows that are kept in memory until flushed out, see above.
|
* @param rowAccessWindowSize the number of rows that are kept in memory until flushed out, see above.
|
||||||
*/
|
*/
|
||||||
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize){
|
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize) {
|
||||||
this(workbook, rowAccessWindowSize, false);
|
this(workbook, rowAccessWindowSize, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +295,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
*
|
*
|
||||||
* @param rowAccessWindowSize the number of rows that are kept in memory until flushed out, see above.
|
* @param rowAccessWindowSize the number of rows that are kept in memory until flushed out, see above.
|
||||||
*/
|
*/
|
||||||
public SXSSFWorkbook(int rowAccessWindowSize){
|
public SXSSFWorkbook(int rowAccessWindowSize) {
|
||||||
this(null /*workbook*/, rowAccessWindowSize);
|
this(null /*workbook*/, rowAccessWindowSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,24 +387,20 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
return new SheetDataWriter(_sharedStringSource);
|
return new SheetDataWriter(_sharedStringSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
XSSFSheet getXSSFSheet(SXSSFSheet sheet)
|
XSSFSheet getXSSFSheet(SXSSFSheet sheet) {
|
||||||
{
|
|
||||||
return _sxFromXHash.get(sheet);
|
return _sxFromXHash.get(sheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
SXSSFSheet getSXSSFSheet(XSSFSheet sheet)
|
SXSSFSheet getSXSSFSheet(XSSFSheet sheet) {
|
||||||
{
|
|
||||||
return _xFromSxHash.get(sheet);
|
return _xFromSxHash.get(sheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerSheetMapping(SXSSFSheet sxSheet,XSSFSheet xSheet)
|
void registerSheetMapping(SXSSFSheet sxSheet,XSSFSheet xSheet) {
|
||||||
{
|
|
||||||
_sxFromXHash.put(sxSheet,xSheet);
|
_sxFromXHash.put(sxSheet,xSheet);
|
||||||
_xFromSxHash.put(xSheet,sxSheet);
|
_xFromSxHash.put(xSheet,sxSheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void deregisterSheetMapping(XSSFSheet xSheet)
|
void deregisterSheetMapping(XSSFSheet xSheet) {
|
||||||
{
|
|
||||||
SXSSFSheet sxSheet = getSXSSFSheet(xSheet);
|
SXSSFSheet sxSheet = getSXSSFSheet(xSheet);
|
||||||
if (sxSheet != null) {
|
if (sxSheet != null) {
|
||||||
// ensure that the writer is closed in all cases to not have lingering writers
|
// ensure that the writer is closed in all cases to not have lingering writers
|
||||||
|
@ -411,10 +410,8 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected XSSFSheet getSheetFromZipEntryName(String sheetRef)
|
protected XSSFSheet getSheetFromZipEntryName(String sheetRef) {
|
||||||
{
|
for(XSSFSheet sheet : _sxFromXHash.values()) {
|
||||||
for(XSSFSheet sheet : _sxFromXHash.values())
|
|
||||||
{
|
|
||||||
if(sheetRef.equals(sheet.getPackagePart().getPartName().getName().substring(1))) {
|
if(sheetRef.equals(sheet.getPackagePart().getPartName().getName().substring(1))) {
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
@ -477,31 +474,25 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
|
|
||||||
// private static void copyStreamAndInjectWorksheet(InputStream in, OutputStream out, InputStream worksheetData) throws IOException {
|
// private static void copyStreamAndInjectWorksheet(InputStream in, OutputStream out, InputStream worksheetData) throws IOException {
|
||||||
private static void copyStreamAndInjectWorksheet(InputStream in, OutputStream out, ISheetInjector sheetInjector) throws IOException {
|
private static void copyStreamAndInjectWorksheet(InputStream in, OutputStream out, ISheetInjector sheetInjector) throws IOException {
|
||||||
InputStreamReader inReader = new InputStreamReader(in, StandardCharsets.UTF_8);
|
Reader inReader = new InputStreamReader(in, StandardCharsets.UTF_8);
|
||||||
OutputStreamWriter outWriter = new OutputStreamWriter(out, StandardCharsets.UTF_8);
|
Writer outWriter = new OutputStreamWriter(out, StandardCharsets.UTF_8);
|
||||||
boolean needsStartTag = true;
|
boolean needsStartTag = true;
|
||||||
int c;
|
int c;
|
||||||
int pos=0;
|
int pos=0;
|
||||||
String s="<sheetData";
|
String s="<sheetData";
|
||||||
int n=s.length();
|
int n=s.length();
|
||||||
//Copy from "in" to "out" up to the string "<sheetData/>" or "</sheetData>" (excluding).
|
//Copy from "in" to "out" up to the string "<sheetData/>" or "</sheetData>" (excluding).
|
||||||
while(((c=inReader.read())!=-1))
|
while(((c=inReader.read())!=-1)) {
|
||||||
{
|
if(c==s.charAt(pos)) {
|
||||||
if(c==s.charAt(pos))
|
|
||||||
{
|
|
||||||
pos++;
|
pos++;
|
||||||
if(pos==n)
|
if(pos==n) {
|
||||||
{
|
if ("<sheetData".equals(s)) {
|
||||||
if ("<sheetData".equals(s))
|
|
||||||
{
|
|
||||||
c = inReader.read();
|
c = inReader.read();
|
||||||
if (c == -1)
|
if (c == -1) {
|
||||||
{
|
|
||||||
outWriter.write(s);
|
outWriter.write(s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c == '>')
|
if (c == '>') {
|
||||||
{
|
|
||||||
// Found <sheetData>
|
// Found <sheetData>
|
||||||
outWriter.write(s);
|
outWriter.write(s);
|
||||||
outWriter.write(c);
|
outWriter.write(c);
|
||||||
|
@ -511,17 +502,14 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
needsStartTag = false;
|
needsStartTag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (c == '/')
|
if (c == '/') {
|
||||||
{
|
|
||||||
// Found <sheetData/
|
// Found <sheetData/
|
||||||
c = inReader.read();
|
c = inReader.read();
|
||||||
if (c == -1)
|
if (c == -1) {
|
||||||
{
|
|
||||||
outWriter.write(s);
|
outWriter.write(s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c == '>')
|
if (c == '>') {
|
||||||
{
|
|
||||||
// Found <sheetData/>
|
// Found <sheetData/>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -538,33 +526,25 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
outWriter.write(c);
|
outWriter.write(c);
|
||||||
pos = 0;
|
pos = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// Found </sheetData>
|
// Found </sheetData>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
if(pos>0) {
|
if(pos>0) {
|
||||||
outWriter.write(s,0,pos);
|
outWriter.write(s,0,pos);
|
||||||
}
|
}
|
||||||
if(c==s.charAt(0))
|
if(c==s.charAt(0)) {
|
||||||
{
|
|
||||||
pos=1;
|
pos=1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
outWriter.write(c);
|
outWriter.write(c);
|
||||||
pos=0;
|
pos=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outWriter.flush();
|
outWriter.flush();
|
||||||
if (needsStartTag)
|
if (needsStartTag) {
|
||||||
{
|
|
||||||
outWriter.write("<sheetData>\n");
|
outWriter.write("<sheetData>\n");
|
||||||
outWriter.flush();
|
outWriter.flush();
|
||||||
}
|
}
|
||||||
|
@ -578,8 +558,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
outWriter.flush();
|
outWriter.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public XSSFWorkbook getXSSFWorkbook()
|
public XSSFWorkbook getXSSFWorkbook() {
|
||||||
{
|
|
||||||
return _wb;
|
return _wb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,8 +572,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the index of the active sheet (0-based)
|
* @return the index of the active sheet (0-based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getActiveSheetIndex()
|
public int getActiveSheetIndex() {
|
||||||
{
|
|
||||||
return _wb.getActiveSheetIndex();
|
return _wb.getActiveSheetIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,8 +584,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param sheetIndex index of the active sheet (0-based)
|
* @param sheetIndex index of the active sheet (0-based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setActiveSheet(int sheetIndex)
|
public void setActiveSheet(int sheetIndex) {
|
||||||
{
|
|
||||||
_wb.setActiveSheet(sheetIndex);
|
_wb.setActiveSheet(sheetIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,8 +594,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the first tab that to display in the list of tabs (0-based).
|
* @return the first tab that to display in the list of tabs (0-based).
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getFirstVisibleTab()
|
public int getFirstVisibleTab() {
|
||||||
{
|
|
||||||
return _wb.getFirstVisibleTab();
|
return _wb.getFirstVisibleTab();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -628,8 +604,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param sheetIndex the first tab that to display in the list of tabs (0-based)
|
* @param sheetIndex the first tab that to display in the list of tabs (0-based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setFirstVisibleTab(int sheetIndex)
|
public void setFirstVisibleTab(int sheetIndex) {
|
||||||
{
|
|
||||||
_wb.setFirstVisibleTab(sheetIndex);
|
_wb.setFirstVisibleTab(sheetIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -640,8 +615,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param pos the position that we want to insert the sheet into (0 based)
|
* @param pos the position that we want to insert the sheet into (0 based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setSheetOrder(String sheetname, int pos)
|
public void setSheetOrder(String sheetname, int pos) {
|
||||||
{
|
|
||||||
_wb.setSheetOrder(sheetname,pos);
|
_wb.setSheetOrder(sheetname,pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,8 +629,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param index the index of the sheet to select (0 based)
|
* @param index the index of the sheet to select (0 based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setSelectedTab(int index)
|
public void setSelectedTab(int index) {
|
||||||
{
|
|
||||||
_wb.setSelectedTab(index);
|
_wb.setSelectedTab(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,8 +640,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @throws IllegalArgumentException if the name is greater than 31 chars or contains <code>/\?*[]</code>
|
* @throws IllegalArgumentException if the name is greater than 31 chars or contains <code>/\?*[]</code>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setSheetName(int sheet, String name)
|
public void setSheetName(int sheet, String name) {
|
||||||
{
|
|
||||||
_wb.setSheetName(sheet,name);
|
_wb.setSheetName(sheet,name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,8 +651,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return Sheet name
|
* @return Sheet name
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getSheetName(int sheet)
|
public String getSheetName(int sheet) {
|
||||||
{
|
|
||||||
return _wb.getSheetName(sheet);
|
return _wb.getSheetName(sheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -691,8 +662,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return index of the sheet (0 based)
|
* @return index of the sheet (0 based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getSheetIndex(String name)
|
public int getSheetIndex(String name) {
|
||||||
{
|
|
||||||
return _wb.getSheetIndex(name);
|
return _wb.getSheetIndex(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -703,8 +673,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return index of the sheet (0 based)
|
* @return index of the sheet (0 based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getSheetIndex(Sheet sheet)
|
public int getSheetIndex(Sheet sheet) {
|
||||||
{
|
|
||||||
return _wb.getSheetIndex(getXSSFSheet((SXSSFSheet)sheet));
|
return _wb.getSheetIndex(getXSSFSheet((SXSSFSheet)sheet));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,8 +684,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return Sheet representing the new sheet.
|
* @return Sheet representing the new sheet.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SXSSFSheet createSheet()
|
public SXSSFSheet createSheet() {
|
||||||
{
|
|
||||||
return createAndRegisterSXSSFSheet(_wb.createSheet());
|
return createAndRegisterSXSSFSheet(_wb.createSheet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,8 +708,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @throws IllegalArgumentException if the name is greater than 31 chars or contains <code>/\?*[]</code>
|
* @throws IllegalArgumentException if the name is greater than 31 chars or contains <code>/\?*[]</code>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SXSSFSheet createSheet(String sheetname)
|
public SXSSFSheet createSheet(String sheetname) {
|
||||||
{
|
|
||||||
return createAndRegisterSXSSFSheet(_wb.createSheet(sheetname));
|
return createAndRegisterSXSSFSheet(_wb.createSheet(sheetname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -765,8 +732,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the number of sheets
|
* @return the number of sheets
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getNumberOfSheets()
|
public int getNumberOfSheets() {
|
||||||
{
|
|
||||||
return _wb.getNumberOfSheets();
|
return _wb.getNumberOfSheets();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -829,8 +795,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return Sheet at the provided index
|
* @return Sheet at the provided index
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SXSSFSheet getSheetAt(int index)
|
public SXSSFSheet getSheetAt(int index) {
|
||||||
{
|
|
||||||
return getSXSSFSheet(_wb.getSheetAt(index));
|
return getSXSSFSheet(_wb.getSheetAt(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -841,8 +806,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return Sheet with the name provided or <code>null</code> if it does not exist
|
* @return Sheet with the name provided or <code>null</code> if it does not exist
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SXSSFSheet getSheet(String name)
|
public SXSSFSheet getSheet(String name) {
|
||||||
{
|
|
||||||
return getSXSSFSheet(_wb.getSheet(name));
|
return getSXSSFSheet(_wb.getSheet(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,8 +816,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param index of the sheet to remove (0-based)
|
* @param index of the sheet to remove (0-based)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void removeSheetAt(int index)
|
public void removeSheetAt(int index) {
|
||||||
{
|
|
||||||
// Get the sheet to be removed
|
// Get the sheet to be removed
|
||||||
XSSFSheet xSheet = _wb.getSheetAt(index);
|
XSSFSheet xSheet = _wb.getSheetAt(index);
|
||||||
SXSSFSheet sxSheet = getSXSSFSheet(xSheet);
|
SXSSFSheet sxSheet = getSXSSFSheet(xSheet);
|
||||||
|
@ -876,8 +839,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return new font object
|
* @return new font object
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Font createFont()
|
public Font createFont() {
|
||||||
{
|
|
||||||
return _wb.createFont();
|
return _wb.createFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -887,8 +849,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the font with the matched attributes or <code>null</code>
|
* @return the font with the matched attributes or <code>null</code>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Font findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline)
|
public Font findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) {
|
||||||
{
|
|
||||||
return _wb.findFont(bold, color, fontHeight, name, italic, strikeout, typeOffset, underline);
|
return _wb.findFont(bold, color, fontHeight, name, italic, strikeout, typeOffset, underline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -900,14 +861,12 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Removal(version = "6.0.0")
|
@Removal(version = "6.0.0")
|
||||||
public int getNumberOfFontsAsInt()
|
public int getNumberOfFontsAsInt() {
|
||||||
{
|
|
||||||
return getNumberOfFonts();
|
return getNumberOfFonts();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Font getFontAt(int idx)
|
public Font getFontAt(int idx) {
|
||||||
{
|
|
||||||
return _wb.getFontAt(idx);
|
return _wb.getFontAt(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -917,8 +876,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the new Cell Style object
|
* @return the new Cell Style object
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CellStyle createCellStyle()
|
public CellStyle createCellStyle() {
|
||||||
{
|
|
||||||
return _wb.createCellStyle();
|
return _wb.createCellStyle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -928,8 +886,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return count of cell styles
|
* @return count of cell styles
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getNumCellStyles()
|
public int getNumCellStyles() {
|
||||||
{
|
|
||||||
return _wb.getNumCellStyles();
|
return _wb.getNumCellStyles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -940,8 +897,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return CellStyle object at the index
|
* @return CellStyle object at the index
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CellStyle getCellStyleAt(int idx)
|
public CellStyle getCellStyleAt(int idx) {
|
||||||
{
|
|
||||||
return _wb.getCellStyleAt(idx);
|
return _wb.getCellStyleAt(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -956,8 +912,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
// ensure that any lingering writer is closed
|
// ensure that any lingering writer is closed
|
||||||
for (SXSSFSheet sheet : _xFromSxHash.values())
|
for (SXSSFSheet sheet : _xFromSxHash.values()) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
SheetDataWriter _writer = sheet.getSheetDataWriter();
|
SheetDataWriter _writer = sheet.getSheetDataWriter();
|
||||||
if (_writer != null) _writer.close();
|
if (_writer != null) _writer.close();
|
||||||
|
@ -1046,11 +1001,9 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* Calling this method will render the workbook unusable.
|
* Calling this method will render the workbook unusable.
|
||||||
* @return true if all temporary files were deleted successfully.
|
* @return true if all temporary files were deleted successfully.
|
||||||
*/
|
*/
|
||||||
public boolean dispose()
|
public boolean dispose() {
|
||||||
{
|
|
||||||
boolean success = true;
|
boolean success = true;
|
||||||
for (SXSSFSheet sheet : _sxFromXHash.keySet())
|
for (SXSSFSheet sheet : _sxFromXHash.keySet()) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
success = sheet.dispose() && success;
|
success = sheet.dispose() && success;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -1065,8 +1018,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the total number of defined names in this workbook
|
* @return the total number of defined names in this workbook
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getNumberOfNames()
|
public int getNumberOfNames() {
|
||||||
{
|
|
||||||
return _wb.getNumberOfNames();
|
return _wb.getNumberOfNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1075,8 +1027,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the defined name with the specified name. <code>null</code> if not found.
|
* @return the defined name with the specified name. <code>null</code> if not found.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Name getName(String name)
|
public Name getName(String name) {
|
||||||
{
|
|
||||||
return _wb.getName(name);
|
return _wb.getName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1097,8 +1048,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return all defined names
|
* @return all defined names
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<? extends Name> getAllNames()
|
public List<? extends Name> getAllNames() {
|
||||||
{
|
|
||||||
return _wb.getAllNames();
|
return _wb.getAllNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1108,8 +1058,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return new defined name object
|
* @return new defined name object
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Name createName()
|
public Name createName() {
|
||||||
{
|
|
||||||
return _wb.createName();
|
return _wb.createName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1119,8 +1068,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param name the name to remove
|
* @param name the name to remove
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void removeName(Name name)
|
public void removeName(Name name) {
|
||||||
{
|
|
||||||
_wb.removeName(name);
|
_wb.removeName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1132,8 +1080,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param reference Valid name Reference for the Print Area
|
* @param reference Valid name Reference for the Print Area
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setPrintArea(int sheetIndex, String reference)
|
public void setPrintArea(int sheetIndex, String reference) {
|
||||||
{
|
|
||||||
_wb.setPrintArea(sheetIndex,reference);
|
_wb.setPrintArea(sheetIndex,reference);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1147,8 +1094,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param endRow Row to end the printarea
|
* @param endRow Row to end the printarea
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)
|
public void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow) {
|
||||||
{
|
|
||||||
_wb.setPrintArea(sheetIndex, startColumn, endColumn, startRow, endRow);
|
_wb.setPrintArea(sheetIndex, startColumn, endColumn, startRow, endRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1160,8 +1106,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return String Null if no print area has been defined
|
* @return String Null if no print area has been defined
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getPrintArea(int sheetIndex)
|
public String getPrintArea(int sheetIndex) {
|
||||||
{
|
|
||||||
return _wb.getPrintArea(sheetIndex);
|
return _wb.getPrintArea(sheetIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1171,8 +1116,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param sheetIndex Zero-based sheet index (0 = First Sheet)
|
* @param sheetIndex Zero-based sheet index (0 = First Sheet)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void removePrintArea(int sheetIndex)
|
public void removePrintArea(int sheetIndex) {
|
||||||
{
|
|
||||||
_wb.removePrintArea(sheetIndex);
|
_wb.removePrintArea(sheetIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1185,8 +1129,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MissingCellPolicy getMissingCellPolicy()
|
public MissingCellPolicy getMissingCellPolicy() {
|
||||||
{
|
|
||||||
return _wb.getMissingCellPolicy();
|
return _wb.getMissingCellPolicy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1199,8 +1142,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* {@link MissingCellPolicy}
|
* {@link MissingCellPolicy}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy)
|
public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) {
|
||||||
{
|
|
||||||
_wb.setMissingCellPolicy(missingCellPolicy);
|
_wb.setMissingCellPolicy(missingCellPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1210,8 +1152,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the DataFormat object
|
* @return the DataFormat object
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DataFormat createDataFormat()
|
public DataFormat createDataFormat() {
|
||||||
{
|
|
||||||
return _wb.createDataFormat();
|
return _wb.createDataFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1230,8 +1171,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @see #PICTURE_TYPE_DIB
|
* @see #PICTURE_TYPE_DIB
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int addPicture(byte[] pictureData, int format)
|
public int addPicture(byte[] pictureData, int format) {
|
||||||
{
|
|
||||||
return _wb.addPicture(pictureData,format);
|
return _wb.addPicture(pictureData,format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1241,8 +1181,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @return the list of pictures (a list of {@link PictureData} objects.)
|
* @return the list of pictures (a list of {@link PictureData} objects.)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<? extends PictureData> getAllPictures()
|
public List<? extends PictureData> getAllPictures() {
|
||||||
{
|
|
||||||
return _wb.getAllPictures();
|
return _wb.getAllPictures();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1262,27 +1201,23 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotImplemented("XSSFWorkbook#isHidden is not implemented")
|
@NotImplemented("XSSFWorkbook#isHidden is not implemented")
|
||||||
public boolean isHidden()
|
public boolean isHidden() {
|
||||||
{
|
|
||||||
return _wb.isHidden();
|
return _wb.isHidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotImplemented("XSSFWorkbook#setHidden is not implemented")
|
@NotImplemented("XSSFWorkbook#setHidden is not implemented")
|
||||||
public void setHidden(boolean hiddenFlag)
|
public void setHidden(boolean hiddenFlag) {
|
||||||
{
|
|
||||||
_wb.setHidden(hiddenFlag);
|
_wb.setHidden(hiddenFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSheetHidden(int sheetIx)
|
public boolean isSheetHidden(int sheetIx) {
|
||||||
{
|
|
||||||
return _wb.isSheetHidden(sheetIx);
|
return _wb.isSheetHidden(sheetIx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSheetVeryHidden(int sheetIx)
|
public boolean isSheetVeryHidden(int sheetIx) {
|
||||||
{
|
|
||||||
return _wb.isSheetVeryHidden(sheetIx);
|
return _wb.isSheetVeryHidden(sheetIx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1292,8 +1227,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSheetHidden(int sheetIx, boolean hidden)
|
public void setSheetHidden(int sheetIx, boolean hidden) {
|
||||||
{
|
|
||||||
_wb.setSheetHidden(sheetIx,hidden);
|
_wb.setSheetHidden(sheetIx,hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1329,8 +1263,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @param toolpack the toolpack to register
|
* @param toolpack the toolpack to register
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addToolPack(UDFFinder toolpack)
|
public void addToolPack(UDFFinder toolpack) {
|
||||||
{
|
|
||||||
_wb.addToolPack(toolpack);
|
_wb.addToolPack(toolpack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1347,7 +1280,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* @since 3.8
|
* @since 3.8
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setForceFormulaRecalculation(boolean value){
|
public void setForceFormulaRecalculation(boolean value) {
|
||||||
_wb.setForceFormulaRecalculation(value);
|
_wb.setForceFormulaRecalculation(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1355,7 +1288,7 @@ public class SXSSFWorkbook implements Workbook {
|
||||||
* Whether Excel will be asked to recalculate all formulas when the workbook is opened.
|
* Whether Excel will be asked to recalculate all formulas when the workbook is opened.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean getForceFormulaRecalculation(){
|
public boolean getForceFormulaRecalculation() {
|
||||||
return _wb.getForceFormulaRecalculation();
|
return _wb.getForceFormulaRecalculation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue