Add missing HSSFWorkbook constructor javadocs #57166
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1635533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a82d32ae8
commit
8616a88a86
@ -184,20 +184,30 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
|
|||||||
this(InternalWorkbook.createWorkbook());
|
this(InternalWorkbook.createWorkbook());
|
||||||
}
|
}
|
||||||
|
|
||||||
private HSSFWorkbook(InternalWorkbook book) {
|
private HSSFWorkbook(InternalWorkbook book) {
|
||||||
super((DirectoryNode)null);
|
super((DirectoryNode)null);
|
||||||
workbook = book;
|
workbook = book;
|
||||||
_sheets = new ArrayList<HSSFSheet>(INITIAL_CAPACITY);
|
_sheets = new ArrayList<HSSFSheet>(INITIAL_CAPACITY);
|
||||||
names = new ArrayList<HSSFName>(INITIAL_CAPACITY);
|
names = new ArrayList<HSSFName>(INITIAL_CAPACITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given a POI POIFSFileSystem object, read in its Workbook along
|
||||||
|
* with all related nodes, and populate the high and low level models.
|
||||||
|
* <p>This calls {@link #HSSFWorkbook(POIFSFileSystem, boolean)} with
|
||||||
|
* preserve nodes set to true.
|
||||||
|
*
|
||||||
|
* @see #HSSFWorkbook(POIFSFileSystem, boolean)
|
||||||
|
* @see org.apache.poi.poifs.filesystem.POIFSFileSystem
|
||||||
|
* @exception IOException if the stream cannot be read
|
||||||
|
*/
|
||||||
public HSSFWorkbook(POIFSFileSystem fs) throws IOException {
|
public HSSFWorkbook(POIFSFileSystem fs) throws IOException {
|
||||||
this(fs,true);
|
this(fs,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* given a POI POIFSFileSystem object, read in its Workbook and populate the high and
|
* Given a POI POIFSFileSystem object, read in its Workbook and populate
|
||||||
* low level models. If you're reading in a workbook...start here.
|
* the high and low level models. If you're reading in a workbook... start here!
|
||||||
*
|
*
|
||||||
* @param fs the POI filesystem that contains the Workbook stream.
|
* @param fs the POI filesystem that contains the Workbook stream.
|
||||||
* @param preserveNodes whether to preseve other nodes, such as
|
* @param preserveNodes whether to preseve other nodes, such as
|
||||||
@ -208,8 +218,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
|
|||||||
* @exception IOException if the stream cannot be read
|
* @exception IOException if the stream cannot be read
|
||||||
*/
|
*/
|
||||||
public HSSFWorkbook(POIFSFileSystem fs, boolean preserveNodes)
|
public HSSFWorkbook(POIFSFileSystem fs, boolean preserveNodes)
|
||||||
throws IOException
|
throws IOException {
|
||||||
{
|
|
||||||
this(fs.getRoot(), fs, preserveNodes);
|
this(fs.getRoot(), fs, preserveNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,13 +347,24 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public HSSFWorkbook(InputStream s) throws IOException {
|
/**
|
||||||
this(s,true);
|
* Companion to HSSFWorkbook(POIFSFileSystem), this constructs the
|
||||||
}
|
* POI filesystem around your inputstream, including all nodes.
|
||||||
|
* <p>This calls {@link #HSSFWorkbook(InputStream, boolean)} with
|
||||||
|
* preserve nodes set to true.
|
||||||
|
*
|
||||||
|
* @see #HSSFWorkbook(InputStream, boolean)
|
||||||
|
* @see #HSSFWorkbook(POIFSFileSystem)
|
||||||
|
* @see org.apache.poi.poifs.filesystem.POIFSFileSystem
|
||||||
|
* @exception IOException if the stream cannot be read
|
||||||
|
*/
|
||||||
|
public HSSFWorkbook(InputStream s) throws IOException {
|
||||||
|
this(s,true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Companion to HSSFWorkbook(POIFSFileSystem), this constructs the POI filesystem around your
|
* Companion to HSSFWorkbook(POIFSFileSystem), this constructs the
|
||||||
* inputstream.
|
* POI filesystem around your inputstream.
|
||||||
*
|
*
|
||||||
* @param s the POI filesystem that contains the Workbook stream.
|
* @param s the POI filesystem that contains the Workbook stream.
|
||||||
* @param preserveNodes whether to preseve other nodes, such as
|
* @param preserveNodes whether to preseve other nodes, such as
|
||||||
@ -354,7 +374,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
|
|||||||
* @see #HSSFWorkbook(POIFSFileSystem)
|
* @see #HSSFWorkbook(POIFSFileSystem)
|
||||||
* @exception IOException if the stream cannot be read
|
* @exception IOException if the stream cannot be read
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public HSSFWorkbook(InputStream s, boolean preserveNodes)
|
public HSSFWorkbook(InputStream s, boolean preserveNodes)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
|
@ -166,6 +166,29 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
|
|||||||
assertEquals("\"Hello!\"", evaluator.evaluate(cXSL_cell).formatAsString());
|
assertEquals("\"Hello!\"", evaluator.evaluate(cXSL_cell).formatAsString());
|
||||||
assertEquals("\"Test A1\"", evaluator.evaluate(cXSL_sNR).formatAsString());
|
assertEquals("\"Test A1\"", evaluator.evaluate(cXSL_sNR).formatAsString());
|
||||||
assertEquals("142.0", evaluator.evaluate(cXSL_gNR).formatAsString());
|
assertEquals("142.0", evaluator.evaluate(cXSL_gNR).formatAsString());
|
||||||
|
|
||||||
|
|
||||||
|
// Now add a formula that refers to a different workbook again
|
||||||
|
Cell cXSLX_nw_cell = rXSLX.createCell(42);
|
||||||
|
cXSLX_nw_cell.setCellFormula("[alt.xslx]Sheet1!$A$1");
|
||||||
|
|
||||||
|
// Check it - TODO Is this correct? Or should it become [2]Sheet1!$A$1 ?
|
||||||
|
assertEquals("[alt.xslx]Sheet1!$A$1", cXSLX_nw_cell.getCellFormula());
|
||||||
|
|
||||||
|
// Evaluate it, without a link to that workbook
|
||||||
|
try {
|
||||||
|
evaluator.evaluate(cXSLX_nw_cell);
|
||||||
|
fail("No cached value and no link to workbook, shouldn't evaluate");
|
||||||
|
} catch(Exception e) {}
|
||||||
|
|
||||||
|
// Add a link, check it does
|
||||||
|
Workbook alt = new XSSFWorkbook();
|
||||||
|
alt.createSheet().createRow(0).createCell(0).setCellValue("In another workbook");
|
||||||
|
evaluators.put("alt.xslx", alt.getCreationHelper().createFormulaEvaluator());
|
||||||
|
evaluator.setupReferencedWorkbooks(evaluators);
|
||||||
|
|
||||||
|
evaluator.evaluate(cXSLX_nw_cell);
|
||||||
|
assertEquals("In another workbook", cXSLX_nw_cell.getStringCellValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user