Fix Javadocs

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2021-04-19 17:30:02 +00:00
parent 32c2de2325
commit cf045a86b0
20 changed files with 126 additions and 123 deletions

View File

@ -144,18 +144,21 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
protected class ExternalName implements Name { protected class ExternalName implements Name {
private CTExternalDefinedName name; private final CTExternalDefinedName name;
protected ExternalName(CTExternalDefinedName name) { protected ExternalName(CTExternalDefinedName name) {
this.name = name; this.name = name;
} }
@Override
public String getNameName() { public String getNameName() {
return name.getName(); return name.getName();
} }
@Override
public void setNameName(String name) { public void setNameName(String name) {
this.name.setName(name); this.name.setName(name);
} }
@Override
public String getSheetName() { public String getSheetName() {
int sheetId = getSheetIndex(); int sheetId = getSheetIndex();
if (sheetId >= 0) { if (sheetId >= 0) {
@ -164,29 +167,35 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
return null; return null;
} }
} }
@Override
public int getSheetIndex() { public int getSheetIndex() {
if (name.isSetSheetId()) { if (name.isSetSheetId()) {
return (int)name.getSheetId(); return (int)name.getSheetId();
} }
return -1; return -1;
} }
@Override
public void setSheetIndex(int sheetId) { public void setSheetIndex(int sheetId) {
name.setSheetId(sheetId); name.setSheetId(sheetId);
} }
@Override
public String getRefersToFormula() { public String getRefersToFormula() {
// Return, without the leading = // Return, without the leading =
return name.getRefersTo().substring(1); return name.getRefersTo().substring(1);
} }
@Override
public void setRefersToFormula(String formulaText) { public void setRefersToFormula(String formulaText) {
// Save with leading = // Save with leading =
name.setRefersTo('=' + formulaText); name.setRefersTo('=' + formulaText);
} }
@Override
public boolean isFunctionName() { public boolean isFunctionName() {
return false; return false;
} }
@Override
public boolean isDeleted() { public boolean isDeleted() {
return false; return false;
} }
@ -196,12 +205,15 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
return false; return false;
} }
@Override
public String getComment() { public String getComment() {
return null; return null;
} }
@Override
public void setComment(String comment) { public void setComment(String comment) {
throw new IllegalStateException("Not Supported"); throw new IllegalStateException("Not Supported");
} }
@Override
public void setFunction(boolean value) { public void setFunction(boolean value) {
throw new IllegalStateException("Not Supported"); throw new IllegalStateException("Not Supported");
} }

View File

@ -49,9 +49,9 @@ public final class SSTRecord extends ContinuableRecord {
* according to docs ONLY SST * according to docs ONLY SST
*/ */
private int field_2_num_unique_strings; private int field_2_num_unique_strings;
private IntMapper<UnicodeString> field_3_strings; private final IntMapper<UnicodeString> field_3_strings;
private SSTDeserializer deserializer; private final SSTDeserializer deserializer;
/** /**
* Offsets from the beginning of the SST record (even across continuations) * Offsets from the beginning of the SST record (even across continuations)
@ -134,6 +134,7 @@ public final class SSTRecord extends ContinuableRecord {
return field_3_strings.get( id ); return field_3_strings.get( id );
} }
@Override
public short getSid() { public short getSid() {
return sid; return sid;
} }
@ -143,8 +144,7 @@ public final class SSTRecord extends ContinuableRecord {
* <P> * <P>
* The data consists of sets of string data. This string data is * The data consists of sets of string data. This string data is
* arranged as follows: * arranged as follows:
* </P> * <pre>{@code
* <pre>
* short string_length; // length of string data * short string_length; // length of string data
* byte string_flag; // flag specifying special string * byte string_flag; // flag specifying special string
* // handling * // handling
@ -157,12 +157,11 @@ public final class SSTRecord extends ContinuableRecord {
* // array is run_count) * // array is run_count)
* byte[] extension; // optional extension (length of array * byte[] extension; // optional extension (length of array
* // is extend_length) * // is extend_length)
* </pre> * }</pre>
* <P> * <P>
* The string_flag is bit mapped as follows: * The string_flag is bit mapped as follows:
* </P> * <TABLE>
* <P> * <caption>string_flag mapping</caption>
* <TABLE summary="string_flag mapping">
* <TR> * <TR>
* <TH>Bit number</TH> * <TH>Bit number</TH>
* <TH>Meaning if 0</TH> * <TH>Meaning if 0</TH>
@ -252,6 +251,7 @@ public final class SSTRecord extends ContinuableRecord {
return field_3_strings.size(); return field_3_strings.size();
} }
@Override
protected void serialize(ContinuableRecordOutput out) { protected void serialize(ContinuableRecordOutput out) {
SSTSerializer serializer = new SSTSerializer(field_3_strings, getNumStrings(), getNumUniqueStrings() ); SSTSerializer serializer = new SSTSerializer(field_3_strings, getNumStrings(), getNumUniqueStrings() );
serializer.serialize(out); serializer.serialize(out);
@ -313,7 +313,7 @@ public final class SSTRecord extends ContinuableRecord {
return GenericRecordUtil.getGenericProperties( return GenericRecordUtil.getGenericProperties(
"numStrings", this::getNumStrings, "numStrings", this::getNumStrings,
"numUniqueStrings", this::getNumUniqueStrings, "numUniqueStrings", this::getNumUniqueStrings,
"strings", () -> field_3_strings.getElements(), "strings", field_3_strings::getElements,
"bucketAbsoluteOffsets", () -> bucketAbsoluteOffsets, "bucketAbsoluteOffsets", () -> bucketAbsoluteOffsets,
"bucketRelativeOffsets", () -> bucketRelativeOffsets "bucketRelativeOffsets", () -> bucketRelativeOffsets
); );

View File

@ -67,7 +67,7 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
public void clearAllCachedResultValues() { public void clearAllCachedResultValues() {
// nothing to do // nothing to do
} }
@Override @Override
public HSSFName createName() { public HSSFName createName() {
return _uBook.createName(); return _uBook.createName();
@ -82,7 +82,7 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
public int getExternalSheetIndex(String workbookName, String sheetName) { public int getExternalSheetIndex(String workbookName, String sheetName) {
return _iBook.getExternalSheetIndex(workbookName, sheetName); return _iBook.getExternalSheetIndex(workbookName, sheetName);
} }
@Override @Override
public Ptg get3DReferencePtg(CellReference cr, SheetIdentifier sheet) { public Ptg get3DReferencePtg(CellReference cr, SheetIdentifier sheet) {
int extIx = getSheetExtIx(sheet); int extIx = getSheetExtIx(sheet);
@ -107,7 +107,7 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
* *
* @param name the name to search * @param name the name to search
* @param sheetIndex the 0-based index of the sheet this formula belongs to. * @param sheetIndex the 0-based index of the sheet this formula belongs to.
* The sheet index is required to resolve sheet-level names. <code>-1</code> means workbook-global names * The sheet index is required to resolve sheet-level names. {@code -1} means workbook-global names
*/ */
@Override @Override
public EvaluationName getName(String name, int sheetIndex) { public EvaluationName getName(String name, int sheetIndex) {
@ -160,10 +160,10 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
// Not actually sheet based at all - is workbook scoped // Not actually sheet based at all - is workbook scoped
return null; return null;
} }
// Look up the local sheet // Look up the local sheet
String sheetName = getSheetName(localSheetIndex); String sheetName = getSheetName(localSheetIndex);
// Is it a single local sheet, or a range? // Is it a single local sheet, or a range?
int lastLocalSheetIndex = _iBook.getLastSheetIndexFromExternSheetIndex(externSheetIndex); int lastLocalSheetIndex = _iBook.getLastSheetIndexFromExternSheetIndex(externSheetIndex);
if (lastLocalSheetIndex == localSheetIndex) { if (lastLocalSheetIndex == localSheetIndex) {
@ -177,7 +177,7 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
} }
/** /**
* @throws IllegalStateException: XSSF-style external references are not supported for HSSF * @throws IllegalStateException XSSF-style external references are not supported for HSSF
*/ */
@Override @Override
public ExternalSheet getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber) { public ExternalSheet getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber) {
@ -190,7 +190,7 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
} }
/** /**
* @throws IllegalStateException: XSSF-style external names are not supported for HSSF * @throws IllegalStateException XSSF-style external names are not supported for HSSF
*/ */
@Override @Override
public ExternalName getExternalName(String nameName, String sheetName, int externalWorkbookNumber) { public ExternalName getExternalName(String nameName, String sheetName, int externalWorkbookNumber) {
@ -275,14 +275,14 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
if (sheetIden == null) { if (sheetIden == null) {
extIx = -1; extIx = -1;
} else { } else {
String workbookName = sheetIden.getBookName(); String workbookName = sheetIden.getBookName();
String firstSheetName = sheetIden.getSheetIdentifier().getName(); String firstSheetName = sheetIden.getSheetIdentifier().getName();
String lastSheetName = firstSheetName; String lastSheetName = firstSheetName;
if (sheetIden instanceof SheetRangeIdentifier) { if (sheetIden instanceof SheetRangeIdentifier) {
lastSheetName = ((SheetRangeIdentifier)sheetIden).getLastSheetIdentifier().getName(); lastSheetName = ((SheetRangeIdentifier)sheetIden).getLastSheetIdentifier().getName();
} }
if (workbookName == null) { if (workbookName == null) {
int firstSheetIndex = _uBook.getSheetIndex(firstSheetName); int firstSheetIndex = _uBook.getSheetIndex(firstSheetName);
int lastSheetIndex = _uBook.getSheetIndex(lastSheetName); int lastSheetIndex = _uBook.getSheetIndex(lastSheetName);
@ -300,7 +300,7 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E
} }
/** /**
* @throws IllegalStateException: data tables are not supported in Excel 97-2003 format * @throws IllegalStateException data tables are not supported in Excel 97-2003 format
*/ */
@Override @Override
public Table getTable(String name) { public Table getTable(String name) {

View File

@ -32,12 +32,12 @@ import org.apache.poi.ss.util.CellReference;
* 'named range' or name of a user defined function. * 'named range' or name of a user defined function.
*/ */
public final class HSSFName implements Name { public final class HSSFName implements Name {
private HSSFWorkbook _book;
private NameRecord _definedNameRec;
private NameCommentRecord _commentRec;
/** private final HSSFWorkbook _book;
private final NameRecord _definedNameRec;
private final NameCommentRecord _commentRec;
/**
* Creates new HSSFName - called by HSSFWorkbook to create a name from * Creates new HSSFName - called by HSSFWorkbook to create a name from
* scratch. * scratch.
* *
@ -48,7 +48,7 @@ public final class HSSFName implements Name {
/* package */ HSSFName(HSSFWorkbook book, NameRecord name) { /* package */ HSSFName(HSSFWorkbook book, NameRecord name) {
this(book, name, null); this(book, name, null);
} }
/** /**
* Creates new HSSFName - called by HSSFWorkbook to create a name from * Creates new HSSFName - called by HSSFWorkbook to create a name from
* scratch. * scratch.
* *
@ -66,6 +66,7 @@ public final class HSSFName implements Name {
/** Get the sheets name which this named range is referenced to /** Get the sheets name which this named range is referenced to
* @return sheet name, which this named range referred to * @return sheet name, which this named range referred to
*/ */
@Override
public String getSheetName() { public String getSheetName() {
int indexToExternSheet = _definedNameRec.getExternSheetNumber(); int indexToExternSheet = _definedNameRec.getExternSheetNumber();
@ -75,6 +76,7 @@ public final class HSSFName implements Name {
/** /**
* @return text name of this defined name * @return text name of this defined name
*/ */
@Override
public String getNameName(){ public String getNameName(){
return _definedNameRec.getNameText(); return _definedNameRec.getNameText();
} }
@ -104,7 +106,7 @@ public final class HSSFName implements Name {
* <p> * <p>
* A name must always be unique within its scope. POI prevents you from defining a name that is not unique * A name must always be unique within its scope. POI prevents you from defining a name that is not unique
* within its scope. However you can use the same name in different scopes. Example: * within its scope. However you can use the same name in different scopes. Example:
* <pre><blockquote> * <pre>{@code
* //by default names are workbook-global * //by default names are workbook-global
* HSSFName name; * HSSFName name;
* name = workbook.createName(); * name = workbook.createName();
@ -122,12 +124,12 @@ public final class HSSFName implements Name {
* name.setSheetIndex(0); * name.setSheetIndex(0);
* name.setNameName("sales_08"); //will throw an exception: "The sheet already contains this name (case-insensitive)" * name.setNameName("sales_08"); //will throw an exception: "The sheet already contains this name (case-insensitive)"
* *
* </blockquote></pre> * }</pre>
* </p>
* *
* @param nameName named range name to set * @param nameName named range name to set
* @throws IllegalArgumentException if the name is invalid or the name already exists (case-insensitive) * @throws IllegalArgumentException if the name is invalid or the name already exists (case-insensitive)
*/ */
@Override
public void setNameName(String nameName){ public void setNameName(String nameName){
validateName(nameName); validateName(nameName);
@ -149,7 +151,7 @@ public final class HSSFName implements Name {
} }
} }
} }
// Update our comment, if there is one // Update our comment, if there is one
if(_commentRec != null) { if(_commentRec != null) {
_commentRec.setNameText(nameName); _commentRec.setNameText(nameName);
@ -159,21 +161,21 @@ public final class HSSFName implements Name {
/** /**
* https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4D0F13AC-53B7-422E-AFD2-ABD7FF379C64#bmsyntax_rules_for_names * https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4D0F13AC-53B7-422E-AFD2-ABD7FF379C64#bmsyntax_rules_for_names
* *
* Valid characters: * Valid characters:
* First character: { letter | underscore | backslash } * First character: { letter | underscore | backslash }
* Remaining characters: { letter | number | period | underscore } * Remaining characters: { letter | number | period | underscore }
* *
* Cell shorthand: cannot be { "C" | "c" | "R" | "r" } * Cell shorthand: cannot be { "C" | "c" | "R" | "r" }
* *
* Cell references disallowed: cannot be a cell reference $A$1 or R1C1 * Cell references disallowed: cannot be a cell reference $A$1 or R1C1
* *
* Spaces are not valid (follows from valid characters above) * Spaces are not valid (follows from valid characters above)
* *
* Name length: (XSSF-specific?) 255 characters maximum * Name length: (XSSF-specific?) 255 characters maximum
* *
* Case sensitivity: all names are case-insensitive * Case sensitivity: all names are case-insensitive
* *
* Uniqueness: must be unique (for names with the same scope) * Uniqueness: must be unique (for names with the same scope)
*/ */
private static void validateName(String name) { private static void validateName(String name) {
@ -187,7 +189,7 @@ public final class HSSFName implements Name {
if (name.equalsIgnoreCase("R") || name.equalsIgnoreCase("C")) { if (name.equalsIgnoreCase("R") || name.equalsIgnoreCase("C")) {
throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be special shorthand R or C"); throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be special shorthand R or C");
} }
// is first character valid? // is first character valid?
char c = name.charAt(0); char c = name.charAt(0);
String allowedSymbols = "_\\"; String allowedSymbols = "_\\";
@ -195,7 +197,7 @@ public final class HSSFName implements Name {
if (!characterIsValid) { if (!characterIsValid) {
throw new IllegalArgumentException("Invalid name: '"+name+"': first character must be underscore or a letter"); throw new IllegalArgumentException("Invalid name: '"+name+"': first character must be underscore or a letter");
} }
// are all other characters valid? // are all other characters valid?
allowedSymbols = "_.\\"; //backslashes needed for unicode escape allowedSymbols = "_.\\"; //backslashes needed for unicode escape
for (final char ch : name.toCharArray()) { for (final char ch : name.toCharArray()) {
@ -204,7 +206,7 @@ public final class HSSFName implements Name {
throw new IllegalArgumentException("Invalid name: '"+name+"': name must be letter, digit, period, or underscore"); throw new IllegalArgumentException("Invalid name: '"+name+"': name must be letter, digit, period, or underscore");
} }
} }
// Is the name a valid $A$1 cell reference // Is the name a valid $A$1 cell reference
// Because $, :, and ! are disallowed characters, A1-style references become just a letter-number combination // Because $, :, and ! are disallowed characters, A1-style references become just a letter-number combination
if (name.matches("[A-Za-z]+\\d+")) { if (name.matches("[A-Za-z]+\\d+")) {
@ -214,18 +216,20 @@ public final class HSSFName implements Name {
throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be $A$1-style cell reference"); throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be $A$1-style cell reference");
} }
} }
// Is the name a valid R1C1 cell reference? // Is the name a valid R1C1 cell reference?
if (name.matches("[Rr]\\d+[Cc]\\d+")) { if (name.matches("[Rr]\\d+[Cc]\\d+")) {
throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be R1C1-style cell reference"); throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be R1C1-style cell reference");
} }
} }
@Override
public void setRefersToFormula(String formulaText) { public void setRefersToFormula(String formulaText) {
Ptg[] ptgs = HSSFFormulaParser.parse(formulaText, _book, FormulaType.NAMEDRANGE, getSheetIndex()); Ptg[] ptgs = HSSFFormulaParser.parse(formulaText, _book, FormulaType.NAMEDRANGE, getSheetIndex());
_definedNameRec.setNameDefinition(ptgs); _definedNameRec.setNameDefinition(ptgs);
} }
@Override
public String getRefersToFormula() { public String getRefersToFormula() {
if (_definedNameRec.isFunctionName()) { if (_definedNameRec.isFunctionName()) {
throw new IllegalStateException("Only applicable to named ranges"); throw new IllegalStateException("Only applicable to named ranges");
@ -240,9 +244,9 @@ public final class HSSFName implements Name {
/** /**
* Sets the NameParsedFormula structure that specifies the formula for the * Sets the NameParsedFormula structure that specifies the formula for the
* defined name. * defined name.
* *
* @param ptgs the sequence of {@link Ptg}s for the formula. * @param ptgs the sequence of {@link Ptg}s for the formula.
*/ */
void setNameDefinition(Ptg[] ptgs) { void setNameDefinition(Ptg[] ptgs) {
@ -250,6 +254,7 @@ public final class HSSFName implements Name {
} }
@Override
public boolean isDeleted(){ public boolean isDeleted(){
Ptg[] ptgs = _definedNameRec.getNameDefinition(); Ptg[] ptgs = _definedNameRec.getNameDefinition();
return Ptg.doesFormulaReferToDeletedCell(ptgs); return Ptg.doesFormulaReferToDeletedCell(ptgs);
@ -260,6 +265,7 @@ public final class HSSFName implements Name {
* *
* @return true if this name is a function name * @return true if this name is a function name
*/ */
@Override
public boolean isFunctionName() { public boolean isFunctionName() {
return _definedNameRec.isFunctionName(); return _definedNameRec.isFunctionName();
} }
@ -270,6 +276,7 @@ public final class HSSFName implements Name {
* *
* @return true if this name is a hidden one * @return true if this name is a hidden one
*/ */
@Override
public boolean isHidden() { public boolean isHidden() {
return _definedNameRec.isHiddenName(); return _definedNameRec.isHiddenName();
} }
@ -287,6 +294,7 @@ public final class HSSFName implements Name {
* to the collection of sheets as they appear in the workbook. * to the collection of sheets as they appear in the workbook.
* @throws IllegalArgumentException if the sheet index is invalid. * @throws IllegalArgumentException if the sheet index is invalid.
*/ */
@Override
public void setSheetIndex(int index){ public void setSheetIndex(int index){
int lastSheetIx = _book.getNumberOfSheets() - 1; int lastSheetIx = _book.getNumberOfSheets() - 1;
if (index < -1 || index > lastSheetIx) { if (index < -1 || index > lastSheetIx) {
@ -302,6 +310,7 @@ public final class HSSFName implements Name {
* *
* @return the sheet index this name applies to, -1 if this name applies to the entire workbook * @return the sheet index this name applies to, -1 if this name applies to the entire workbook
*/ */
@Override
public int getSheetIndex(){ public int getSheetIndex(){
return _definedNameRec.getSheetNumber() - 1; return _definedNameRec.getSheetNumber() - 1;
} }
@ -311,6 +320,7 @@ public final class HSSFName implements Name {
* *
* @return the user comment for this named range * @return the user comment for this named range
*/ */
@Override
public String getComment() { public String getComment() {
if(_commentRec != null) { if(_commentRec != null) {
// Prefer the comment record if it has text in it // Prefer the comment record if it has text in it
@ -327,6 +337,7 @@ public final class HSSFName implements Name {
* *
* @param comment the user comment for this named range * @param comment the user comment for this named range
*/ */
@Override
public void setComment(String comment){ public void setComment(String comment){
// Update the main record // Update the main record
_definedNameRec.setDescriptionText(comment); _definedNameRec.setDescriptionText(comment);
@ -340,8 +351,9 @@ public final class HSSFName implements Name {
* Indicates that the defined name refers to a user-defined function. * Indicates that the defined name refers to a user-defined function.
* This attribute is used when there is an add-in or other code project associated with the file. * This attribute is used when there is an add-in or other code project associated with the file.
* *
* @param value <code>true</code> indicates the name refers to a function. * @param value {@code true} indicates the name refers to a function.
*/ */
@Override
public void setFunction(boolean value) { public void setFunction(boolean value) {
_definedNameRec.setFunction(value); _definedNameRec.setFunction(value);
} }

View File

@ -370,7 +370,7 @@ public final class CryptoFunctions {
* *
* @see <a href="http://msdn.microsoft.com/en-us/library/dd926947.aspx">2.3.7.1 Binary Document Password Verifier Derivation Method 1</a> * @see <a href="http://msdn.microsoft.com/en-us/library/dd926947.aspx">2.3.7.1 Binary Document Password Verifier Derivation Method 1</a>
* @see <a href="http://msdn.microsoft.com/en-us/library/dd905229.aspx">2.3.7.4 Binary Document Password Verifier Derivation Method 2</a> * @see <a href="http://msdn.microsoft.com/en-us/library/dd905229.aspx">2.3.7.4 Binary Document Password Verifier Derivation Method 2</a>
* @see <a href="http://www.ecma-international.org/news/TC45_current_work/Office Open XML Part 4 - Markup Language Reference.pdf">Part 4 - Markup Language Reference - Ecma International - 3.2.12 fileSharing</a> * @see <a href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Part 4 - Markup Language Reference - Ecma International - 3.2.12 fileSharing</a>
* *
* @param password the password * @param password the password
* @return the verifier (actually a short value) * @return the verifier (actually a short value)

View File

@ -49,7 +49,7 @@ public enum SpreadsheetVersion {
* (actually limited by available memory in Excel)</li> * (actually limited by available memory in Excel)</li>
* <li>Number of cell styles is 64000</li> * <li>Number of cell styles is 64000</li>
* <li>Length of text cell contents is 32767</li> * <li>Length of text cell contents is 32767</li>
* <ul> * </ul>
*/ */
EXCEL2007(0x100000, 0x4000, 255, Integer.MAX_VALUE, 64000, 32767); EXCEL2007(0x100000, 0x4000, 255, Integer.MAX_VALUE, 64000, 32767);
@ -60,7 +60,7 @@ public enum SpreadsheetVersion {
private final int _maxCellStyles; private final int _maxCellStyles;
private final int _maxTextLength; private final int _maxTextLength;
private SpreadsheetVersion(int maxRows, int maxColumns, int maxFunctionArgs, int maxCondFormats, int maxCellStyles, int maxText) { SpreadsheetVersion(int maxRows, int maxColumns, int maxFunctionArgs, int maxCondFormats, int maxCellStyles, int maxText) {
_maxRows = maxRows; _maxRows = maxRows;
_maxColumns = maxColumns; _maxColumns = maxColumns;
_maxFunctionArgs = maxFunctionArgs; _maxFunctionArgs = maxFunctionArgs;
@ -77,7 +77,7 @@ public enum SpreadsheetVersion {
} }
/** /**
* @return the last (maximum) valid row index, equals to <code> getMaxRows() - 1 </code> * @return the last (maximum) valid row index, equals to {@code getMaxRows() - 1 }
*/ */
public int getLastRowIndex() { public int getLastRowIndex() {
return _maxRows - 1; return _maxRows - 1;
@ -91,7 +91,7 @@ public enum SpreadsheetVersion {
} }
/** /**
* @return the last (maximum) valid column index, equals to <code> getMaxColumns() - 1 </code> * @return the last (maximum) valid column index, equals to {@code getMaxColumns() - 1 }
*/ */
public int getLastColumnIndex() { public int getLastColumnIndex() {
return _maxColumns - 1; return _maxColumns - 1;
@ -121,7 +121,7 @@ public enum SpreadsheetVersion {
/** /**
* *
* @return the last valid column index in a ALPHA-26 representation * @return the last valid column index in a ALPHA-26 representation
* (<code>IV</code> or <code>XFD</code>). * ({@code IV} or {@code XFD}).
*/ */
public String getLastColumnName() { public String getLastColumnName() {
return CellReference.convertNumToColString(getLastColumnIndex()); return CellReference.convertNumToColString(getLastColumnIndex());

View File

@ -17,7 +17,6 @@
package org.apache.poi.ss.format; package org.apache.poi.ss.format;
import java.util.Locale; import java.util.Locale;
import java.util.logging.Logger;
import org.apache.poi.util.LocaleUtil; import org.apache.poi.util.LocaleUtil;
@ -25,9 +24,6 @@ import org.apache.poi.util.LocaleUtil;
* This is the abstract supertype for the various cell formatters. * This is the abstract supertype for the various cell formatters.
*/ */
public abstract class CellFormatter { public abstract class CellFormatter {
/** The logger to use in the formatting code. */
private static final Logger LOG = Logger.getLogger(CellFormatter.class.getName());
/** The original specified format. */ /** The original specified format. */
protected final String format; protected final String format;
protected final Locale locale; protected final Locale locale;
@ -54,7 +50,7 @@ public abstract class CellFormatter {
/** /**
* Format a value according the format string. * Format a value according the format string.
* <p/> * <p>
* NOTE: this method must be thread safe! In particular, if it uses a * NOTE: this method must be thread safe! In particular, if it uses a
* Format instance that is not thread safe, i.e. DateFormat, this method * Format instance that is not thread safe, i.e. DateFormat, this method
* must be synchronized, either on the method, if the format is a final * must be synchronized, either on the method, if the format is a final
@ -67,7 +63,7 @@ public abstract class CellFormatter {
/** /**
* Format a value according to the type, in the most basic way. * Format a value according to the type, in the most basic way.
* <p/> * <p>
* NOTE: this method must be thread safe! In particular, if it uses a * NOTE: this method must be thread safe! In particular, if it uses a
* Format instance that is not thread safe, i.e. DateFormat, this method * Format instance that is not thread safe, i.e. DateFormat, this method
* must be synchronized, either on the method, if the format is a final * must be synchronized, either on the method, if the format is a final

View File

@ -41,6 +41,7 @@ public class CellGeneralFormatter extends CellFormatter {
* @param toAppendTo The buffer to append to. * @param toAppendTo The buffer to append to.
* @param value The value to format. * @param value The value to format.
*/ */
@Override
public void formatValue(StringBuffer toAppendTo, Object value) { public void formatValue(StringBuffer toAppendTo, Object value) {
if (value instanceof Number) { if (value instanceof Number) {
double val = ((Number) value).doubleValue(); double val = ((Number) value).doubleValue();
@ -86,6 +87,7 @@ public class CellGeneralFormatter extends CellFormatter {
} }
/** Equivalent to {@link #formatValue(StringBuffer,Object)}. {@inheritDoc}. */ /** Equivalent to {@link #formatValue(StringBuffer,Object)}. {@inheritDoc}. */
@Override
public void simpleValue(StringBuffer toAppendTo, Object value) { public void simpleValue(StringBuffer toAppendTo, Object value) {
formatValue(toAppendTo, value); formatValue(toAppendTo, value);
} }

View File

@ -50,7 +50,7 @@ public class CellTextFormatter extends CellFormatter {
} }
} }
/** {@inheritDoc} */ @Override
public void formatValue(StringBuffer toAppendTo, Object obj) { public void formatValue(StringBuffer toAppendTo, Object obj) {
int start = toAppendTo.length(); int start = toAppendTo.length();
String text = obj.toString(); String text = obj.toString();
@ -69,6 +69,7 @@ public class CellTextFormatter extends CellFormatter {
* <p> * <p>
* For text, this is just printing the text. * For text, this is just printing the text.
*/ */
@Override
public void simpleValue(StringBuffer toAppendTo, Object value) { public void simpleValue(StringBuffer toAppendTo, Object value) {
SIMPLE_TEXT.formatValue(toAppendTo, value); SIMPLE_TEXT.formatValue(toAppendTo, value);
} }

View File

@ -81,7 +81,7 @@ public interface EvaluationWorkbook {
* *
* @since POI 3.15 beta 3 * @since POI 3.15 beta 3
*/ */
public void clearAllCachedResultValues(); void clearAllCachedResultValues();
class ExternalSheet { class ExternalSheet {
private final String _workbookName; private final String _workbookName;

View File

@ -28,7 +28,7 @@ import org.apache.poi.util.Internal;
@Internal @Internal
public interface FormulaRenderingWorkbook { public interface FormulaRenderingWorkbook {
/** /**
* @return <code>null</code> if externSheetIndex refers to a sheet inside the current workbook * @return {@code null} if externSheetIndex refers to a sheet inside the current workbook
*/ */
ExternalSheet getExternalSheet(int externSheetIndex); ExternalSheet getExternalSheet(int externSheetIndex);

View File

@ -20,8 +20,6 @@ package org.apache.poi.ss.formula.eval;
import org.apache.poi.ss.formula.functions.ArrayFunction; import org.apache.poi.ss.formula.functions.ArrayFunction;
import org.apache.poi.ss.formula.functions.Fixed2ArgFunction; import org.apache.poi.ss.formula.functions.Fixed2ArgFunction;
import org.apache.poi.ss.formula.functions.Function; import org.apache.poi.ss.formula.functions.Function;
import org.apache.poi.ss.formula.functions.MatrixFunction.MutableValueCollector;
import org.apache.poi.ss.formula.functions.MatrixFunction.TwoArrayArg;
public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction implements ArrayFunction { public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction implements ArrayFunction {
@ -30,7 +28,8 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple
return OperandResolver.coerceValueToDouble(ve); return OperandResolver.coerceValueToDouble(ve);
} }
public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { @Override
public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex) {
if (args.length != 2) { if (args.length != 2) {
return ErrorEval.VALUE_INVALID; return ErrorEval.VALUE_INVALID;
} }
@ -50,6 +49,7 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple
} }
@Override
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) {
double result; double result;
try { try {
@ -73,35 +73,14 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple
protected abstract double evaluate(double d0, double d1) throws EvaluationException; protected abstract double evaluate(double d0, double d1) throws EvaluationException;
private final class ArrayEval extends TwoArrayArg {
private final MutableValueCollector instance = new MutableValueCollector(true, true);
protected double[] collectValues(ValueEval arg) throws EvaluationException {
return instance.collectValues(arg);
}
protected double[][] evaluate(double[][] d1, double[][] d2) throws IllegalArgumentException, EvaluationException {
int width = (d1[0].length < d2[0].length) ? d1[0].length : d2[0].length;
int height = (d1.length < d2.length) ? d1.length : d2.length;
double[][] result = new double[height][width];
for (int j = 0; j < height; j++) {
for (int i = 0; i < width; i++) {
result[j][i] = TwoOperandNumericOperation.this.evaluate(d1[j][i], d2[j][i]);
}
}
return result;
}
}
public static final Function AddEval = new TwoOperandNumericOperation() { public static final Function AddEval = new TwoOperandNumericOperation() {
@Override
protected double evaluate(double d0, double d1) { protected double evaluate(double d0, double d1) {
return d0+d1; return d0+d1;
} }
}; };
public static final Function DivideEval = new TwoOperandNumericOperation() { public static final Function DivideEval = new TwoOperandNumericOperation() {
@Override
protected double evaluate(double d0, double d1) throws EvaluationException { protected double evaluate(double d0, double d1) throws EvaluationException {
if (d1 == 0.0) { if (d1 == 0.0) {
throw new EvaluationException(ErrorEval.DIV_ZERO); throw new EvaluationException(ErrorEval.DIV_ZERO);
@ -110,11 +89,13 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple
} }
}; };
public static final Function MultiplyEval = new TwoOperandNumericOperation() { public static final Function MultiplyEval = new TwoOperandNumericOperation() {
@Override
protected double evaluate(double d0, double d1) { protected double evaluate(double d0, double d1) {
return d0*d1; return d0*d1;
} }
}; };
public static final Function PowerEval = new TwoOperandNumericOperation() { public static final Function PowerEval = new TwoOperandNumericOperation() {
@Override
protected double evaluate(double d0, double d1) { protected double evaluate(double d0, double d1) {
if(d0 < 0 && Math.abs(d1) > 0.0 && Math.abs(d1) < 1.0) { if(d0 < 0 && Math.abs(d1) > 0.0 && Math.abs(d1) < 1.0) {
return -1 * Math.pow(d0 * -1, d1); return -1 * Math.pow(d0 * -1, d1);
@ -126,6 +107,7 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple
public SubtractEvalClass() { public SubtractEvalClass() {
// //
} }
@Override
protected double evaluate(double d0, double d1) { protected double evaluate(double d0, double d1) {
return d0-d1; return d0-d1;
} }

View File

@ -36,7 +36,7 @@ import org.apache.poi.util.Internal;
* Represents a workbook being used for forked evaluation. Most operations are delegated to the * Represents a workbook being used for forked evaluation. Most operations are delegated to the
* shared master workbook, except those that potentially involve cell values that may have been * shared master workbook, except those that potentially involve cell values that may have been
* updated after a call to {@link #getOrCreateUpdatableCell(String, int, int)}.<br> * updated after a call to {@link #getOrCreateUpdatableCell(String, int, int)}.<br>
* *
* For POI internal use only * For POI internal use only
*/ */
@Internal @Internal
@ -117,7 +117,7 @@ final class ForkedEvaluationWorkbook implements EvaluationWorkbook {
public EvaluationSheet getSheet(int sheetIndex) { public EvaluationSheet getSheet(int sheetIndex) {
return getSharedSheet(getSheetName(sheetIndex)); return getSharedSheet(getSheetName(sheetIndex));
} }
@Override @Override
public ExternalName getExternalName(int externSheetIndex, int externNameIndex) { public ExternalName getExternalName(int externSheetIndex, int externNameIndex) {
return _masterBook.getExternalName(externSheetIndex, externNameIndex); return _masterBook.getExternalName(externSheetIndex, externNameIndex);
@ -155,15 +155,16 @@ final class ForkedEvaluationWorkbook implements EvaluationWorkbook {
public UDFFinder getUDFFinder() { public UDFFinder getUDFFinder() {
return _masterBook.getUDFFinder(); return _masterBook.getUDFFinder();
} }
@Override
public SpreadsheetVersion getSpreadsheetVersion() { public SpreadsheetVersion getSpreadsheetVersion() {
return _masterBook.getSpreadsheetVersion(); return _masterBook.getSpreadsheetVersion();
} }
/* (non-Javadoc) /* (non-Javadoc)
* leave the map alone, if it needs resetting, reusing this class is probably a bad idea. * leave the map alone, if it needs resetting, reusing this class is probably a bad idea.
* @see org.apache.poi.ss.formula.EvaluationSheet#clearAllCachedResultValues() * @see org.apache.poi.ss.formula.EvaluationSheet#clearAllCachedResultValues()
* *
* @since POI 3.15 beta 3 * @since POI 3.15 beta 3
*/ */
@Override @Override

View File

@ -48,7 +48,7 @@ public interface ArrayFunction {
* @param arg0 the first function argument. Empty values are represented with * @param arg0 the first function argument. Empty values are represented with
* {@link BlankEval} or {@link MissingArgEval}, never {@code null} * {@link BlankEval} or {@link MissingArgEval}, never {@code null}
* @param arg1 the first function argument. Empty values are represented with * @param arg1 the first function argument. Empty values are represented with
* @link BlankEval} or {@link MissingArgEval}, never {@code null} * {@link BlankEval} or {@link MissingArgEval}, never {@code null}
* *
* @param srcRowIndex row index of the cell containing the formula under evaluation * @param srcRowIndex row index of the cell containing the formula under evaluation
* @param srcColumnIndex column index of the cell containing the formula under evaluation * @param srcColumnIndex column index of the cell containing the formula under evaluation

View File

@ -29,7 +29,6 @@ import org.apache.poi.ss.formula.functions.CountUtils.I_MatchPredicate;
* <caption>Parameter descriptions</caption> * <caption>Parameter descriptions</caption>
* <tr><th>range&nbsp;&nbsp;&nbsp;</th><td>is the range of cells to count blanks</td></tr> * <tr><th>range&nbsp;&nbsp;&nbsp;</th><td>is the range of cells to count blanks</td></tr>
* </table> * </table>
* </p>
*/ */
public final class Countblank extends Fixed1ArgFunction { public final class Countblank extends Fixed1ArgFunction {

View File

@ -197,7 +197,7 @@ public abstract class TextFunction implements Function {
* MID returns a specific number of * MID returns a specific number of
* characters from a text string, starting at the specified position.<p> * characters from a text string, starting at the specified position.<p>
* *
* <b>Syntax<b>:<br> <b>MID</b>(<b>text</b>, <b>start_num</b>, * <b>Syntax</b>:<br> <b>MID</b>(<b>text</b>, <b>start_num</b>,
* <b>num_chars</b>)<br> * <b>num_chars</b>)<br>
* *
* Author: Manda Wilson &lt; wilson at c bio dot msk cc dot org &gt; * Author: Manda Wilson &lt; wilson at c bio dot msk cc dot org &gt;
@ -335,7 +335,7 @@ public abstract class TextFunction implements Function {
* {@link DataFormatter} to be done, as this works much the same as the * {@link DataFormatter} to be done, as this works much the same as the
* display focused work that that does. * display focused work that that does.
* *
* <b>Syntax<b>:<br> <b>TEXT</b>(<b>value</b>, <b>format_text</b>)<br> * <b>Syntax</b>:<br> <b>TEXT</b>(<b>value</b>, <b>format_text</b>)<br>
*/ */
public static final Function TEXT = new Fixed2ArgFunction() { public static final Function TEXT = new Fixed2ArgFunction() {

View File

@ -62,7 +62,6 @@ public enum HorizontalAlignment {
* left/right edge, don't append the additional occurrence of the value.</li> * left/right edge, don't append the additional occurrence of the value.</li>
* <li>The display value of the cell is filled, not the underlying raw number.</li> * <li>The display value of the cell is filled, not the underlying raw number.</li>
* </ol> * </ol>
* </p>
*/ */
FILL, FILL,
@ -92,7 +91,7 @@ public enum HorizontalAlignment {
* <p> Two lines inside a cell are separated by a carriage return. </p> * <p> Two lines inside a cell are separated by a carriage return. </p>
*/ */
DISTRIBUTED; DISTRIBUTED;
public short getCode() { public short getCode() {
return (short) ordinal(); return (short) ordinal();
} }

View File

@ -90,7 +90,7 @@ public interface Name {
* <p> * <p>
* A name must always be unique within its scope. POI prevents you from defining a name that is not unique * A name must always be unique within its scope. POI prevents you from defining a name that is not unique
* within its scope. However you can use the same name in different scopes. Example: * within its scope. However you can use the same name in different scopes. Example:
* <pre><blockquote> * <pre>{@code
* //by default names are workbook-global * //by default names are workbook-global
* Name name; * Name name;
* name = workbook.createName(); * name = workbook.createName();
@ -108,8 +108,8 @@ public interface Name {
* name.setSheetIndex(0); * name.setSheetIndex(0);
* name.setNameName("sales_08"); //will throw an exception: "The sheet already contains this name (case-insensitive)" * name.setNameName("sales_08"); //will throw an exception: "The sheet already contains this name (case-insensitive)"
* *
* </blockquote></pre> * }</pre>
* </p> *
* @param name named range name to set * @param name named range name to set
* @throws IllegalArgumentException if the name is invalid or the already exists within its scope (case-insensitive) * @throws IllegalArgumentException if the name is invalid or the already exists within its scope (case-insensitive)
*/ */
@ -118,7 +118,7 @@ public interface Name {
/** /**
* Returns the formula that the name is defined to refer to. * Returns the formula that the name is defined to refer to.
* *
* @return the reference for this name, <code>null</code> if it has not been set yet. Never empty string * @return the reference for this name, {@code null} if it has not been set yet. Never empty string
* @see #setRefersToFormula(String) * @see #setRefersToFormula(String)
*/ */
String getRefersToFormula(); String getRefersToFormula();
@ -127,11 +127,11 @@ public interface Name {
* Sets the formula that the name is defined to refer to. The following are representative examples: * Sets the formula that the name is defined to refer to. The following are representative examples:
* *
* <ul> * <ul>
* <li><code>'My Sheet'!$A$3</code></li> * <li>{@code 'My Sheet'!$A$3}</li>
* <li><code>8.3</code></li> * <li>{@code 8.3}</li>
* <li><code>HR!$A$1:$Z$345</code></li> * <li>{@code HR!$A$1:$Z$345}</li>
* <li><code>SUM(Sheet1!A1,Sheet2!B2)</li> * <li>{@code SUM(Sheet1!A1,Sheet2!B2)}</li>
* <li><code>-PMT(Interest_Rate/12,Number_of_Payments,Loan_Amount)</li> * <li>{@code -PMT(Interest_Rate/12,Number_of_Payments,Loan_Amount)}</li>
* </ul> * </ul>
* *
* Note: Using relative values like 'A1:B1' can lead to unexpected moving of * Note: Using relative values like 'A1:B1' can lead to unexpected moving of
@ -154,7 +154,7 @@ public interface Name {
/** /**
* Checks if this name points to a cell that no longer exists * Checks if this name points to a cell that no longer exists
* *
* @return <code>true</code> if the name refers to a deleted cell, <code>false</code> otherwise * @return {@code true} if the name refers to a deleted cell, {@code false} otherwise
*/ */
boolean isDeleted(); boolean isDeleted();
@ -162,7 +162,7 @@ public interface Name {
* Checks if this name is hidden, eg one of the built-in Excel * Checks if this name is hidden, eg one of the built-in Excel
* internal names * internal names
* *
* @return <code>true</code> if the name is a hidden name, <code>false</code> otherwise * @return {@code true} if the name is a hidden name, {@code false} otherwise
*/ */
boolean isHidden(); boolean isHidden();
@ -172,34 +172,34 @@ public interface Name {
* @param sheetId the sheet index this name applies to, -1 unsets this property making the name workbook-global * @param sheetId the sheet index this name applies to, -1 unsets this property making the name workbook-global
* @throws IllegalArgumentException if the sheet index is invalid. * @throws IllegalArgumentException if the sheet index is invalid.
*/ */
public void setSheetIndex(int sheetId); void setSheetIndex(int sheetId);
/** /**
* Returns the sheet index this name applies to. * Returns the sheet index this name applies to.
* *
* @return the sheet index this name applies to, -1 if this name applies to the entire workbook * @return the sheet index this name applies to, -1 if this name applies to the entire workbook
*/ */
public int getSheetIndex(); int getSheetIndex();
/** /**
* Returns the comment the user provided when the name was created. * Returns the comment the user provided when the name was created.
* *
* @return the user comment for this named range * @return the user comment for this named range
*/ */
public String getComment(); String getComment();
/** /**
* Sets the comment the user provided when the name was created. * Sets the comment the user provided when the name was created.
* *
* @param comment the user comment for this named range * @param comment the user comment for this named range
*/ */
public void setComment(String comment); void setComment(String comment);
/** /**
* Indicates that the defined name refers to a user-defined function. * Indicates that the defined name refers to a user-defined function.
* This attribute is used when there is an add-in or other code project associated with the file. * This attribute is used when there is an add-in or other code project associated with the file.
* *
* @param value <code>true</code> indicates the name refers to a function. * @param value {@code true} indicates the name refers to a function.
*/ */
void setFunction(boolean value); void setFunction(boolean value);
} }

View File

@ -385,7 +385,7 @@ public class AreaReference {
* Example return values: * Example return values:
* <table> * <table>
* <caption>Example return values</caption> * <caption>Example return values</caption>
* <tr><th align='left'>Result</th><th align='left'>Comment</th></tr> * <tr><th>Result</th><th>Comment</th></tr>
* <tr><td>A1:A1</td><td>Single cell area reference without sheet</td></tr> * <tr><td>A1:A1</td><td>Single cell area reference without sheet</td></tr>
* <tr><td>A1:$C$1</td><td>Multi-cell area reference without sheet</td></tr> * <tr><td>A1:$C$1</td><td>Multi-cell area reference without sheet</td></tr>
* <tr><td>Sheet1!A$1:B4</td><td>Standard sheet name</td></tr> * <tr><td>Sheet1!A$1:B4</td><td>Standard sheet name</td></tr>

View File

@ -300,8 +300,8 @@ public class CellReference implements GenericRecord {
* *
* POI currently targets BIFF8 (Excel 97-2003), so the following behaviour can be observed for * POI currently targets BIFF8 (Excel 97-2003), so the following behaviour can be observed for
* this method: * this method:
* <blockquote><table border="0" cellpadding="1" cellspacing="0" * <table>
* summary="Notable cases."> * <caption>Notable cases</caption>
* <tr><th>Input&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th> * <tr><th>Input&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
* <th>Result&nbsp;</th></tr> * <th>Result&nbsp;</th></tr>
* <tr><td>"A", "1"</td><td>true</td></tr> * <tr><td>"A", "1"</td><td>true</td></tr>
@ -313,7 +313,7 @@ public class CellReference implements GenericRecord {
* <tr><td>"AAA", "1"</td><td>false</td></tr> * <tr><td>"AAA", "1"</td><td>false</td></tr>
* <tr><td>"a", "111"</td><td>true</td></tr> * <tr><td>"a", "111"</td><td>true</td></tr>
* <tr><td>"Sheet", "1"</td><td>false</td></tr> * <tr><td>"Sheet", "1"</td><td>false</td></tr>
* </table></blockquote> * </table>
* *
* @param colStr a string of only letter characters * @param colStr a string of only letter characters
* @param rowStr a string of only digit characters * @param rowStr a string of only digit characters
@ -485,7 +485,7 @@ public class CellReference implements GenericRecord {
* Example return values: * Example return values:
* <table> * <table>
* <caption>Example return values</caption> * <caption>Example return values</caption>
* <tr><th align='left'>Result</th><th align='left'>Comment</th></tr> * <tr><th>Result</th><th>Comment</th></tr>
* <tr><td>A1</td><td>Cell reference without sheet</td></tr> * <tr><td>A1</td><td>Cell reference without sheet</td></tr>
* <tr><td>Sheet1!A1</td><td>Standard sheet name</td></tr> * <tr><td>Sheet1!A1</td><td>Standard sheet name</td></tr>
* <tr><td>'O''Brien''s Sales'!A1'&nbsp;</td><td>Sheet name with special characters</td></tr> * <tr><td>'O''Brien''s Sales'!A1'&nbsp;</td><td>Sheet name with special characters</td></tr>
@ -502,8 +502,9 @@ public class CellReference implements GenericRecord {
* *
* <p> * <p>
* Example return values: * Example return values:
* <table border="0" cellpadding="1" cellspacing="0" summary="Example return values"> * <table>
* <tr><th align='left'>Result</th><th align='left'>Comment</th></tr> * <caption>Example return values</caption>
* <tr><th>Result</th><th>Comment</th></tr>
* <tr><td>A1</td><td>Cell reference without sheet</td></tr> * <tr><td>A1</td><td>Cell reference without sheet</td></tr>
* <tr><td>Sheet1!A1</td><td>Standard sheet name</td></tr> * <tr><td>Sheet1!A1</td><td>Standard sheet name</td></tr>
* <tr><td>'O''Brien''s Sales'!A1'&nbsp;</td><td>Sheet name with special characters</td></tr> * <tr><td>'O''Brien''s Sales'!A1'&nbsp;</td><td>Sheet name with special characters</td></tr>
@ -583,9 +584,7 @@ public class CellReference implements GenericRecord {
&& _colIndex == cr._colIndex && _colIndex == cr._colIndex
&& _isRowAbs == cr._isRowAbs && _isRowAbs == cr._isRowAbs
&& _isColAbs == cr._isColAbs && _isColAbs == cr._isColAbs
&& ((_sheetName == null) && Objects.equals(_sheetName, cr._sheetName);
? (cr._sheetName == null)
: _sheetName.equals(cr._sheetName));
} }
@Override @Override