You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2021/04/14 22:53:38 UTC
svn commit: r1888780 [11/13] - in /poi/trunk:
poi-examples/src/main/java/org/apache/poi/examples/hslf/
poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/
poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/
poi-exampl...
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java Wed Apr 14 22:53:33 2021
@@ -32,7 +32,7 @@ public final class RefErrorPtg extends O
private static final int SIZE = 5;
public static final byte sid = 0x2A;
- private int field_1_reserved;
+ private final int field_1_reserved;
public RefErrorPtg() {
field_1_reserved = 0;
@@ -47,6 +47,7 @@ public final class RefErrorPtg extends O
field_1_reserved = in.readInt();
}
+ @Override
public void write(LittleEndianOutput out) {
out.writeByte(sid + getPtgClass());
out.writeInt(field_1_reserved);
@@ -57,14 +58,17 @@ public final class RefErrorPtg extends O
return sid;
}
+ @Override
public int getSize() {
return SIZE;
}
+ @Override
public String toFormulaString() {
return FormulaError.REF.getString();
}
+ @Override
public byte getDefaultOperandClass() {
return Ptg.CLASS_REF;
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java Wed Apr 14 22:53:33 2021
@@ -22,11 +22,13 @@ package org.apache.poi.ss.formula.ptg;
* Common superclass of all {@link Ptg Ptgs} that represent simple constant values.
*/
public abstract class ScalarConstantPtg extends Ptg {
+ @Override
public final boolean isBaseToken() {
return true;
}
- public final byte getDefaultOperandClass() {
+ @Override
+ public final byte getDefaultOperandClass() {
return Ptg.CLASS_VALUE;
}
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java Wed Apr 14 22:53:33 2021
@@ -20,9 +20,6 @@ package org.apache.poi.ss.formula.ptg;
import org.apache.poi.util.LittleEndianOutput;
-/**
- * @author Glen Stampoultzis (glens at apache.org)
- */
public final class UnionPtg extends OperationPtg {
public static final byte sid = 0x10;
@@ -32,6 +29,7 @@ public final class UnionPtg extends Oper
// enforce singleton
}
+ @Override
public final boolean isBaseToken() {
return true;
}
@@ -41,14 +39,17 @@ public final class UnionPtg extends Oper
return sid;
}
+ @Override
public int getSize() {
return 1;
}
+ @Override
public void write(LittleEndianOutput out) {
out.writeByte(sid + getPtgClass());
}
+ @Override
public String toFormulaString()
{
return ",";
@@ -56,10 +57,12 @@ public final class UnionPtg extends Oper
/** implementation of method from OperationsPtg*/
+ @Override
public String toFormulaString(String[] operands) {
return operands[0] + "," + operands[1];
}
+ @Override
public int getNumberOfOperands()
{
return 2;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java Wed Apr 14 22:53:33 2021
@@ -29,9 +29,11 @@ public class UnknownPtg extends Ptg {
_sid = sid;
}
+ @Override
public boolean isBaseToken() {
return true;
}
+ @Override
public void write(LittleEndianOutput out) {
out.writeByte(_sid);
}
@@ -41,13 +43,16 @@ public class UnknownPtg extends Ptg {
return (byte)_sid;
}
+ @Override
public int getSize() {
return size;
}
+ @Override
public String toFormulaString() {
return "UNKNOWN";
}
+ @Override
public byte getDefaultOperandClass() {
return Ptg.CLASS_VALUE;
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java Wed Apr 14 22:53:33 2021
@@ -29,24 +29,29 @@ public abstract class ValueOperatorPtg e
protected ValueOperatorPtg() {}
/**
- * All Operator <tt>Ptg</tt>s are base tokens (i.e. are not RVA classified)
+ * All Operator {@code Ptg}s are base tokens (i.e. are not RVA classified)
*/
+ @Override
public final boolean isBaseToken() {
return true;
}
- public final byte getDefaultOperandClass() {
+ @Override
+ public final byte getDefaultOperandClass() {
return Ptg.CLASS_VALUE;
}
+ @Override
public void write(LittleEndianOutput out) {
out.writeByte(getSid());
}
+ @Override
public final int getSize() {
return 1;
}
+ @Override
public final String toFormulaString() {
// TODO - prune this method out of the hierarchy
throw new RuntimeException("toFormulaString(String[] operands) should be used for subclasses of OperationPtgs");
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java Wed Apr 14 22:53:33 2021
@@ -26,14 +26,12 @@ import java.util.Collection;
/**
* Collects add-in libraries and VB macro functions together into one UDF finder
- *
- * @author PUdalau
*/
public class AggregatingUDFFinder implements UDFFinder {
-
+
/**
* Default UDFFinder implementation
- */
+ */
public static final UDFFinder DEFAULT = new AggregatingUDFFinder(AnalysisToolPak.instance);
private final Collection<UDFFinder> _usedToolPacks;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java Wed Apr 14 22:53:33 2021
@@ -25,8 +25,6 @@ import org.apache.poi.ss.formula.functio
/**
* Default UDF finder - for adding your own user defined functions.
- *
- * @author PUdalau
*/
public final class DefaultUDFFinder implements UDFFinder {
private final Map<String, FreeRefFunction> _functionsByName;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java Wed Apr 14 22:53:33 2021
@@ -23,8 +23,6 @@ import java.util.HashMap;
/**
* A UDFFinder that can retrieve functions both by name and by fake index.
- *
- * @author Yegor Kozlov
*/
@Internal
public class IndexedUDFFinder extends AggregatingUDFFinder {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java Wed Apr 14 22:53:33 2021
@@ -31,7 +31,6 @@ import java.util.Locale;
/**
* Common implementation-independent logic shared by all implementations of {@link Cell}.
- * @author Vladislav "gallon" Galas gallon at apache dot org
*/
public abstract class CellBase implements Cell {
/**
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java Wed Apr 14 22:53:33 2021
@@ -29,7 +29,7 @@ public interface CellRange<C extends Cel
/**
* Gets the number of cells in this range.
- * @return <tt>height * width </tt>
+ * @return {@code height * width }
*/
int size();
@@ -40,24 +40,24 @@ public interface CellRange<C extends Cel
String getReferenceText();
/**
- * @return the cell at relative coordinates (0,0). Never <code>null</code>.
+ * @return the cell at relative coordinates (0,0). Never {@code null}.
*/
C getTopLeftCell();
/**
- * @param relativeRowIndex must be between <tt>0</tt> and <tt>height-1</tt>
- * @param relativeColumnIndex must be between <tt>0</tt> and <tt>width-1</tt>
- * @return the cell at the specified coordinates. Never <code>null</code>.
+ * @param relativeRowIndex must be between {@code 0} and {@code height-1}
+ * @param relativeColumnIndex must be between {@code 0} and {@code width-1}
+ * @return the cell at the specified coordinates. Never {@code null}.
*/
C getCell(int relativeRowIndex, int relativeColumnIndex);
/**
- * @return a flattened array of all the cells in this {@link CellRange}
+ * @return a flattened array of all the cells in this CellRange
*/
C[] getFlattenedCells();
/**
- * @return a 2-D array of all the cells in this {@link CellRange}. The first
- * array dimension is the row index (values <tt>0...height-1</tt>)
- * and the second dimension is the column index (values <tt>0...width-1</tt>)
+ * @return a 2-D array of all the cells in this CellRange. The first
+ * array dimension is the row index (values {@code 0...height-1})
+ * and the second dimension is the column index (values {@code 0...width-1})
*/
C[][] getCells();
@@ -65,5 +65,6 @@ public interface CellRange<C extends Cel
* @return an {@link Iterator} over all cells in this range. Iteration starts
* with all cells in the first row followed by all cells in the next row, etc.
*/
+ @Override
Iterator<C> iterator();
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java Wed Apr 14 22:53:33 2021
@@ -24,31 +24,22 @@ import org.apache.poi.ss.util.CellRangeA
/**
* The ConditionalFormatting class encapsulates all settings of Conditional Formatting.
*
- * The class can be used
- *
- * <UL>
- * <LI>
- * to make a copy ConditionalFormatting settings.
- * </LI>
- *
- *
+ * The class can be used to make a copy ConditionalFormatting settings.
+ * <p>
* For example:
- * <PRE>
+ * <pre>{@code
* ConditionalFormatting cf = sheet.getConditionalFormattingAt(index);
* newSheet.addConditionalFormatting(cf);
- * </PRE>
+ * }</pre>
*
- * <LI>
- * or to modify existing Conditional Formatting settings (formatting regions and/or rules).
- * </LI>
- * </UL>
+ * or to modify existing Conditional Formatting settings (formatting regions and/or rules).<p>
*
* Use {@link org.apache.poi.ss.usermodel.Sheet#getSheetConditionalFormatting()}
* to get access to an instance of this class.
- * <P>
+ * <p>
* To create a new Conditional Formatting set use the following approach:
*
- * <PRE>
+ * <pre>{@code
*
* // Define a Conditional Formatting rule, which triggers formatting
* // when cell's value is greater or equal than 100.0 and
@@ -71,18 +62,18 @@ import org.apache.poi.ss.util.CellRangeA
*
* // Apply Conditional Formatting rule defined above to the regions
* sheet.addConditionalFormatting(regions, rule);
- * </PRE>
+ * }</pre>
*/
public interface ConditionalFormatting {
/**
- * @return array of <tt>CellRangeAddress</tt>s. Never <code>null</code>
+ * @return array of {@code CellRangeAddress}s. Never {@code null}
*/
CellRangeAddress[] getFormattingRanges();
/**
* Sets the cell ranges the rule conditional formatting must be applied to.
- * @param ranges non-null array of <tt>CellRangeAddress</tt>s
+ * @param ranges non-null array of {@code CellRangeAddress}s
*/
void setFormattingRanges(CellRangeAddress[] ranges);
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java Wed Apr 14 22:53:33 2021
@@ -66,26 +66,25 @@ import org.apache.poi.util.LocaleUtil;
* prefix or suffix.
* </p>
* <p>
- * For example the Excel pattern <code>"$#,##0.00 "USD"_);($#,##0.00 "USD")"
- * </code> will be correctly formatted as "$1,000.00 USD" or "($1,000.00 USD)".
- * However the pattern <code>"00-00-00"</code> is incorrectly formatted by
+ * For example the Excel pattern {@code "$#,##0.00 "USD"_);($#,##0.00 "USD")"
+ * } will be correctly formatted as "$1,000.00 USD" or "($1,000.00 USD)".
+ * However the pattern {@code "00-00-00"} is incorrectly formatted by
* DecimalFormat as "000000--". For Excel formats that are not compatible with
* DecimalFormat, you can provide your own custom {@link Format} implementation
- * via <code>DataFormatter.addFormat(String,Format)</code>. The following
+ * via {@code DataFormatter.addFormat(String,Format)}. The following
* custom formats are already provided by this class:
* </p>
- * <pre>
- * <ul><li>SSN "000-00-0000"</li>
- * <li>Phone Number "(###) ###-####"</li>
- * <li>Zip plus 4 "00000-0000"</li>
- * </ul>
- * </pre>
+ * <pre>{@code
+ * SSN "000-00-0000"
+ * Phone Number "(###) ###-####"
+ * Zip plus 4 "00000-0000"
+ * }</pre>
* <p>
* If the Excel format pattern cannot be parsed successfully, then a default
* format will be used. The default number format will mimic the Excel General
* format: "#" for whole numbers and "#.##########" for decimal numbers. You
- * can override the default format pattern with <code>
- * DataFormatter.setDefaultNumberFormat(Format)</code>. <b>Note:</b> the
+ * can override the default format pattern with {@code
+ * DataFormatter.setDefaultNumberFormat(Format)}. <b>Note:</b> the
* default format will only be used when a Format cannot be created from the
* cell's data format string.
*
@@ -95,24 +94,24 @@ import org.apache.poi.util.LocaleUtil;
* </p>
* <p>Example:</p>
* <p>
- * Consider a numeric cell with a value <code>12.343</code> and format <code>"##.##_ "</code>.
- * The trailing underscore and space ("_ ") in the format adds a space to the end and Excel formats this cell as <code>"12.34 "</code>,
- * but <code>DataFormatter</code> trims the formatted value and returns <code>"12.34"</code>.
+ * Consider a numeric cell with a value {@code 12.343} and format {@code "##.##_ "}.
+ * The trailing underscore and space ("_ ") in the format adds a space to the end and Excel formats this cell as {@code "12.34 "},
+ * but {@code DataFormatter} trims the formatted value and returns {@code "12.34"}.
* </p>
- * You can enable spaces by passing the <code>emulateCSV=true</code> flag in the <code>DateFormatter</code> cosntructor.
+ * You can enable spaces by passing the {@code emulateCSV=true} flag in the {@code DateFormatter} cosntructor.
* If set to true, then the output tries to conform to what you get when you take an xls or xlsx in Excel and Save As CSV file:
* <ul>
* <li>returned values are not trimmed</li>
* <li>Invalid dates are formatted as 255 pound signs ("#")</li>
* <li>simulate Excel's handling of a format string of all # when the value is 0.
- * Excel will output "", <code>DataFormatter</code> will output "0".
+ * Excel will output "", {@code DataFormatter} will output "0".
* </ul>
* <p>
* Some formats are automatically "localized" by Excel, eg show as mm/dd/yyyy when
* loaded in Excel in some Locales but as dd/mm/yyyy in others. These are always
* returned in the "default" (US) format, as stored in the file.
* Some format strings request an alternate locale, eg
- * <code>[$-809]d/m/yy h:mm AM/PM</code> which explicitly requests UK locale.
+ * {@code [$-809]d/m/yy h:mm AM/PM} which explicitly requests UK locale.
* These locale directives are (currently) ignored.
* You can use {@link DateFormatConverter} to do some of this localisation if
* you need it.
@@ -269,7 +268,7 @@ public class DataFormatter {
/**
* Return a Format for the given cell if one exists, otherwise try to
- * create one. This method will return <code>null</code> if any of the
+ * create one. This method will return {@code null} if any of the
* following is true:
* <ul>
* <li>the cell's style is null</li>
@@ -685,7 +684,7 @@ public class DataFormatter {
private static class InternalDecimalFormatWithScale extends Format {
private static final Pattern endsWithCommas = Pattern.compile("(,+)$");
- private BigDecimal divider;
+ private final BigDecimal divider;
private static final BigDecimal ONE_THOUSAND = new BigDecimal(1000);
private final DecimalFormat df;
private static String trimTrailingCommas(String s) {
@@ -798,8 +797,8 @@ public class DataFormatter {
}
/**
- * Returns the formatted value of an Excel date as a <tt>String</tt> based
- * on the cell's <code>DataFormat</code>. i.e. "Thursday, January 02, 2003"
+ * Returns the formatted value of an Excel date as a {@code String} based
+ * on the cell's {@code DataFormat}. i.e. "Thursday, January 02, 2003"
* , "01/02/2003" , "02-Jan" , etc.
* <p>
* If any conditional format rules apply, the highest priority with a number format is used.
@@ -839,8 +838,8 @@ public class DataFormatter {
}
/**
- * Returns the formatted value of an Excel number as a <tt>String</tt>
- * based on the cell's <code>DataFormat</code>. Supported formats include
+ * Returns the formatted value of an Excel number as a {@code String}
+ * based on the cell's {@code DataFormat}. Supported formats include
* currency, percents, decimals, phone number, SSN, etc.:
* "61.54%", "$100.00", "(800) 555-1234".
* <p>
@@ -929,7 +928,7 @@ public class DataFormatter {
/**
* <p>
- * Returns the formatted value of a cell as a <tt>String</tt> regardless
+ * Returns the formatted value of a cell as a {@code String} regardless
* of the cell type. If the Excel format pattern cannot be parsed then the
* cell value will be formatted using a default format.
* </p>
@@ -946,7 +945,7 @@ public class DataFormatter {
/**
* <p>
- * Returns the formatted value of a cell as a <tt>String</tt> regardless
+ * Returns the formatted value of a cell as a {@code String} regardless
* of the cell type. If the Excel number format pattern cannot be parsed then the
* cell value will be formatted using a default format.
* </p>
@@ -967,7 +966,7 @@ public class DataFormatter {
/**
* <p>
- * Returns the formatted value of a cell as a <tt>String</tt> regardless
+ * Returns the formatted value of a cell as a {@code String} regardless
* of the cell type. If the Excel number format pattern cannot be parsed then the
* cell value will be formatted using a default format.
* </p>
@@ -1038,9 +1037,9 @@ public class DataFormatter {
* </p>
* <p>
* The value that will be passed to the Format's format method (specified
- * by <code>java.text.Format#format</code>) will be a double value from a
+ * by {@code java.text.Format#format}) will be a double value from a
* numeric cell. Therefore the code in the format method should expect a
- * <code>Number</code> value.
+ * {@code Number} value.
* </p>
*
* @param format A Format instance to be used as a default
@@ -1059,9 +1058,9 @@ public class DataFormatter {
* Adds a new format to the available formats.
* <p>
* The value that will be passed to the Format's format method (specified
- * by <code>java.text.Format#format</code>) will be a double value from a
+ * by {@code java.text.Format#format}) will be a double value from a
* numeric cell. Therefore the code in the format method should expect a
- * <code>Number</code> value.
+ * {@code Number} value.
* </p>
* @param excelFormatStr The data format string
* @param format A Format instance
@@ -1073,7 +1072,7 @@ public class DataFormatter {
// Some custom formats
/**
- * @return a <tt>DecimalFormat</tt> with parseIntegerOnly set <code>true</code>
+ * @return a {@code DecimalFormat} with parseIntegerOnly set {@code true}
*/
private static DecimalFormat createIntegerOnlyFormat(String fmt) {
DecimalFormatSymbols dsf = DecimalFormatSymbols.getInstance(Locale.ROOT);
@@ -1164,8 +1163,6 @@ public class DataFormatter {
/**
* Format class for Excel's SSN format. This class mimics Excel's built-in
* SSN formatting.
- *
- * @author James May
*/
@SuppressWarnings("serial")
private static final class SSNFormat extends Format {
@@ -1197,7 +1194,6 @@ public class DataFormatter {
/**
* Format class for Excel Zip + 4 format. This class mimics Excel's
* built-in formatting for Zip + 4.
- * @author James May
*/
@SuppressWarnings("serial")
private static final class ZipPlusFourFormat extends Format {
@@ -1228,7 +1224,6 @@ public class DataFormatter {
/**
* Format class for Excel phone number format. This class mimics Excel's
* built-in phone number formatting.
- * @author James May
*/
@SuppressWarnings("serial")
private static final class PhoneFormat extends Format {
@@ -1312,6 +1307,7 @@ public class DataFormatter {
private CellFormatResultWrapper(CellFormatResult result) {
this.result = result;
}
+ @Override
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
if (emulateCSV) {
return toAppendTo.append(result.text);
@@ -1319,6 +1315,7 @@ public class DataFormatter {
return toAppendTo.append(result.text.trim());
}
}
+ @Override
public Object parseObject(String source, ParsePosition pos) {
return null; // Not supported
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java Wed Apr 14 22:53:33 2021
@@ -18,29 +18,25 @@ package org.apache.poi.ss.usermodel;
import org.apache.poi.ss.util.CellRangeAddressList;
-/**
- * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a>
- *
- */
public interface DataValidationHelper {
-
+
DataValidationConstraint createFormulaListConstraint(String listFormula);
DataValidationConstraint createExplicitListConstraint(String[] listOfValues);
DataValidationConstraint createNumericConstraint(int validationType,int operatorType, String formula1, String formula2);
-
+
DataValidationConstraint createTextLengthConstraint(int operatorType, String formula1, String formula2);
-
+
DataValidationConstraint createDecimalConstraint(int operatorType, String formula1, String formula2);
-
+
DataValidationConstraint createIntegerConstraint(int operatorType, String formula1, String formula2);
-
+
DataValidationConstraint createDateConstraint(int operatorType, String formula1, String formula2,String dateFormat);
-
+
DataValidationConstraint createTimeConstraint(int operatorType, String formula1, String formula2);
-
+
DataValidationConstraint createCustomConstraint(String formula);
-
+
DataValidation createValidation(DataValidationConstraint constraint,CellRangeAddressList cellRangeAddressList);
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java Wed Apr 14 22:53:33 2021
@@ -21,8 +21,6 @@ package org.apache.poi.ss.usermodel;
/**
* The font family this font belongs to. A font family is a set of fonts having common stroke width and serif
* characteristics. The font name overrides when there are conflicting values.
- *
- * @author Gisella Bronzetti
*/
public enum FontFamily {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java Wed Apr 14 22:53:33 2021
@@ -24,8 +24,6 @@ package org.apache.poi.ss.usermodel;
* When a new theme is chosen, every font that is part of a theme definition is updated to use the new major or minor font definition for that
* theme.
* Usually major fonts are used for styles like headings, and minor fonts are used for body & paragraph text.
- *
- * @author Gisella Bronzetti
*/
public enum FontScheme {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java Wed Apr 14 22:53:33 2021
@@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel;
/**
* the different types of possible underline formatting
- *
- * @author Gisella Bronzetti
*/
public enum FontUnderline {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java Wed Apr 14 22:53:33 2021
@@ -23,13 +23,10 @@ import java.util.Map;
/**
* Evaluates formula cells.<p>
- *
+ *
* For performance reasons, this class keeps a cache of all previously calculated intermediate
* cell values. Be sure to call {@link #clearAllCachedResultValues()} if any workbook cells are changed between
* calls to evaluate~ methods on this class.
- *
- * @author Amol S. Deshmukh < amolweb at ya hoo dot com >
- * @author Josh Micich
*/
public interface FormulaEvaluator {
@@ -40,7 +37,7 @@ public interface FormulaEvaluator {
*/
void clearAllCachedResultValues();
/**
- * Should be called to tell the cell value cache that the specified (value or formula) cell
+ * Should be called to tell the cell value cache that the specified (value or formula) cell
* has changed.
* Failure to call this method after changing cell values will cause incorrect behaviour
* of the evaluate~ methods of this class
@@ -48,7 +45,7 @@ public interface FormulaEvaluator {
void notifySetFormula(Cell cell);
/**
* Should be called to tell the cell value cache that the specified cell has just become a
- * formula cell, or the formula text has changed
+ * formula cell, or the formula text has changed
*/
void notifyDeleteCell(Cell cell);
@@ -62,14 +59,14 @@ public interface FormulaEvaluator {
/**
* Loops over all cells in all sheets of the associated workbook.
- * For cells that contain formulas, their formulas are evaluated,
+ * For cells that contain formulas, their formulas are evaluated,
* and the results are saved. These cells remain as formula cells.
* For cells that do not contain formulas, no changes are made.
- * This is a helpful wrapper around looping over all cells, and
+ * This is a helpful wrapper around looping over all cells, and
* calling evaluateFormulaCell on each one.
*/
void evaluateAll();
-
+
/**
* If cell contains a formula, the formula is evaluated and returned,
* else the CellValue simply copies the appropriate cell value from
@@ -97,7 +94,7 @@ public interface FormulaEvaluator {
* and the result. If you want the cell replaced with
* the result of the formula, use {@link #evaluateInCell(Cell)}
* @param cell The cell to evaluate
- * @return The type of the formula result, i.e. -1 if the cell is not a formula,
+ * @return The type of the formula result, i.e. -1 if the cell is not a formula,
* or one of {@link CellType#NUMERIC}, {@link CellType#STRING},
* {@link CellType#BOOLEAN}, {@link CellType#ERROR}
* Note: the cell's type remains as CellType.FORMULA however.
@@ -121,7 +118,7 @@ public interface FormulaEvaluator {
* @param cell The {@link Cell} to evaluate and modify.
*/
Cell evaluateInCell(Cell cell);
-
+
/**
* Sets up the Formula Evaluator to be able to reference and resolve
* links to other workbooks, eg [Test.xls]Sheet1!A1.
@@ -139,7 +136,7 @@ public interface FormulaEvaluator {
* In some cases external workbooks referenced by formulas in the main workbook are not available.
* With this method you can control how POI handles such missing references:
* <ul>
- * <li>by default ignoreMissingWorkbooks=false and POI throws
+ * <li>by default ignoreMissingWorkbooks=false and POI throws
* {@link org.apache.poi.ss.formula.CollaboratingWorkbooksEnvironment.WorkbookNotFoundException}
* if an external reference cannot be resolved</li>
* <li>if ignoreMissingWorkbooks=true then POI uses cached formula result
@@ -149,13 +146,13 @@ public interface FormulaEvaluator {
* @param ignore whether to ignore missing references to external workbooks
*/
void setIgnoreMissingWorkbooks(boolean ignore);
-
+
/**
* Perform detailed output of formula evaluation for next evaluation only?
* Is for developer use only (also developers using POI for their XLS files).
* Log-Level WARN is for basic info, INFO for detailed information. These quite
* high levels are used because you have to explicitly enable this specific logging.
-
+
* @param value whether to perform detailed output
*/
void setDebugEvaluationOutputForNextEval(boolean value);
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java Wed Apr 14 22:53:33 2021
@@ -25,9 +25,6 @@ package org.apache.poi.ss.usermodel;
* Each element corresponds to a color index (zero-based). When using the default indexed color palette,
* the values are not written out, but instead are implied. When the color palette has been modified from default,
* then the entire color palette is used.
- * </p>
- *
- * @author Yegor Kozlov
*/
public enum IndexedColors {
@@ -96,7 +93,7 @@ public enum IndexedColors {
_values[color.index] = color;
}
}
-
+
public final short index;
IndexedColors(int idx){
@@ -111,9 +108,9 @@ public enum IndexedColors {
public short getIndex(){
return index;
}
-
+
/**
- *
+ *
*
* @param index the index of the color
* @return the corresponding IndexedColors enum
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java Wed Apr 14 22:53:33 2021
@@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel;
/**
* Specifies printed page order.
- *
- * @author Gisella Bronzetti
*/
public enum PageOrder {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java Wed Apr 14 22:53:33 2021
@@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel;
/**
* The enumeration value indicating the possible paper size for a sheet
- *
- * @author Daniele Montagni
*/
public enum PaperSize {
LETTER_PAPER,
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java Wed Apr 14 22:53:33 2021
@@ -19,9 +19,6 @@
package org.apache.poi.ss.usermodel;
-/**
- * @author Yegor Kozlov
- */
public interface PatternFormatting {
/** No background */
public static final short NO_FILL = 0 ;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java Wed Apr 14 22:53:33 2021
@@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel;
/**
* These enumerations specify how cell comments shall be displayed for paper printing purposes.
- *
- * @author Gisella Bronzetti
*/
public enum PrintCellComments {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java Wed Apr 14 22:53:33 2021
@@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel;
/**
* The enumeration value indicating the print orientation for a sheet.
- *
- * @author Gisella Bronzetti
*/
public enum PrintOrientation {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java Wed Apr 14 22:53:33 2021
@@ -18,14 +18,11 @@
package org.apache.poi.ss.usermodel;
/**
- * Rich text unicode string. These strings can have fonts
+ * Rich text unicode string. These strings can have fonts
* applied to arbitary parts of the string.
- *
- * @author Glen Stampoultzis (glens at apache.org)
- * @author Jason Height (jheight at apache.org)
*/
public interface RichTextString {
-
+
/**
* Applies a font to the specified characters of a string.
*
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java Wed Apr 14 22:53:33 2021
@@ -18,8 +18,6 @@ package org.apache.poi.ss.usermodel;
/**
* All known types of automatic shapes in DrawingML
- *
- * @author Yegor Kozlov
*/
public class ShapeTypes {
public static final int LINE = 1;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java Wed Apr 14 22:53:33 2021
@@ -127,7 +127,7 @@ public interface Sheet extends Iterable<
* Get the hidden state for a given column
*
* @param columnIndex - the column to set (0-based)
- * @return hidden - <code>false</code> if the column is visible
+ * @return hidden - {@code false} if the column is visible
*/
boolean isColumnHidden(int columnIndex);
@@ -153,7 +153,7 @@ public interface Sheet extends Iterable<
* in a cell that is formatted with the standard font (first font in the workbook).<p>
*
* Character width is defined as the maximum digit width
- * of the numbers <code>0, 1, 2, ... 9</code> as rendered
+ * of the numbers {@code 0, 1, 2, ... 9} as rendered
* using the default font (first font in the workbook).<p>
*
* Unless you are using a very special font, the default character is '0' (zero),
@@ -166,19 +166,19 @@ public interface Sheet extends Iterable<
* To compute the actual number of visible characters,
* Excel uses the following formula (Section 3.3.1.12 of the OOXML spec):<p>
*
- * <code>
+ * {@code
* width = Truncate([{Number of Visible Characters} *
* {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256
- * </code>
+ * }
*
* Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi).
- * If you set a column width to be eight characters wide, e.g. <code>setColumnWidth(columnIndex, 8*256)</code>,
+ * If you set a column width to be eight characters wide, e.g. {@code setColumnWidth(columnIndex, 8*256)},
* then the actual value of visible characters (the value shown in Excel) is derived from the following equation:
- * <code>
+ * {@code
* Truncate([numChars*7+5]/7*256)/256 = 8;
- * </code>
+ * }
*
- * which gives <code>7.29</code>.
+ * which gives {@code 7.29}.
*
* @param columnIndex - the column to set (0-based)
* @param width - the width in units of 1/256th of a character width
@@ -191,7 +191,7 @@ public interface Sheet extends Iterable<
*
* <p>
* Character width is defined as the maximum digit width
- * of the numbers <code>0, 1, 2, ... 9</code> as rendered
+ * of the numbers {@code 0, 1, 2, ... 9} as rendered
* using the default font (first font in the workbook)
* </p>
*
@@ -409,7 +409,7 @@ public interface Sheet extends Iterable<
/**
* Flag indicating whether the sheet displays Automatic Page Breaks.
*
- * @param value <code>true</code> if the sheet displays Automatic Page Breaks.
+ * @param value {@code true} if the sheet displays Automatic Page Breaks.
*/
void setAutobreaks(boolean value);
@@ -440,7 +440,7 @@ public interface Sheet extends Iterable<
/**
* Flag indicating whether the Fit to Page print option is enabled.
*
- * @param value <code>true</code> if the Fit to Page print option is enabled.
+ * @param value {@code true} if the Fit to Page print option is enabled.
*/
void setFitToPage(boolean value);
@@ -455,7 +455,7 @@ public interface Sheet extends Iterable<
* When false a summary row is inserted above the detailed data being summarized and a new outline level
* is established on that row.
* </p>
- * @param value <code>true</code> if row summaries appear below detail in the outline
+ * @param value {@code true} if row summaries appear below detail in the outline
*/
void setRowSumsBelow(boolean value);
@@ -470,14 +470,14 @@ public interface Sheet extends Iterable<
* When false a summary column is inserted to the left of the detailed data being
* summarized and a new outline level is established on that column.
* </p>
- * @param value <code>true</code> if col summaries appear right of the detail in the outline
+ * @param value {@code true} if col summaries appear right of the detail in the outline
*/
void setRowSumsRight(boolean value);
/**
* Flag indicating whether the sheet displays Automatic Page Breaks.
*
- * @return <code>true</code> if the sheet displays Automatic Page Breaks.
+ * @return {@code true} if the sheet displays Automatic Page Breaks.
*/
boolean getAutobreaks();
@@ -492,7 +492,7 @@ public interface Sheet extends Iterable<
/**
* Flag indicating whether the Fit to Page print option is enabled.
*
- * @return <code>true</code> if the Fit to Page print option is enabled.
+ * @return {@code true} if the Fit to Page print option is enabled.
*/
boolean getFitToPage();
@@ -507,7 +507,7 @@ public interface Sheet extends Iterable<
* When false a summary row is inserted above the detailed data being summarized and a new outline level
* is established on that row.
* </p>
- * @return <code>true</code> if row summaries appear below detail in the outline
+ * @return {@code true} if row summaries appear below detail in the outline
*/
boolean getRowSumsBelow();
@@ -522,7 +522,7 @@ public interface Sheet extends Iterable<
* When false a summary column is inserted to the left of the detailed data being
* summarized and a new outline level is established on that column.
* </p>
- * @return <code>true</code> if col summaries appear right of the detail in the outline
+ * @return {@code true} if col summaries appear right of the detail in the outline
*/
boolean getRowSumsRight();
@@ -530,7 +530,7 @@ public interface Sheet extends Iterable<
* Gets the flag indicating whether this sheet displays the lines
* between rows and columns to make editing and reading easier.
*
- * @return <code>true</code> if this sheet prints gridlines.
+ * @return {@code true} if this sheet prints gridlines.
* @see #isDisplayGridlines() to check if gridlines are displayed on screen
*/
boolean isPrintGridlines();
@@ -539,7 +539,7 @@ public interface Sheet extends Iterable<
* Sets the flag indicating whether this sheet should print the lines
* between rows and columns to make editing and reading easier.
*
- * @param show <code>true</code> if this sheet should print gridlines.
+ * @param show {@code true} if this sheet should print gridlines.
* @see #setDisplayGridlines(boolean) to display gridlines on screen
*/
void setPrintGridlines(boolean show);
@@ -548,7 +548,7 @@ public interface Sheet extends Iterable<
* Gets the flag indicating whether this sheet prints the
* row and column headings when printing.
*
- * @return <code>true</code> if this sheet prints row and column headings.
+ * @return {@code true} if this sheet prints row and column headings.
*/
boolean isPrintRowAndColumnHeadings();
@@ -556,7 +556,7 @@ public interface Sheet extends Iterable<
* Sets the flag indicating whether this sheet should print
* row and columns headings when printing.
*
- * @param show <code>true</code> if this sheet should print row and column headings.
+ * @param show {@code true} if this sheet should print row and column headings.
*/
void setPrintRowAndColumnHeadings(boolean show);
@@ -572,7 +572,7 @@ public interface Sheet extends Iterable<
*
* Note that XSSF offers more kinds of document headers than HSSF does
*
- * @return the document header. Never <code>null</code>
+ * @return the document header. Never {@code null}
*/
Header getHeader();
@@ -581,7 +581,7 @@ public interface Sheet extends Iterable<
*
* Note that XSSF offers more kinds of document footers than HSSF does.
*
- * @return the document footer. Never <code>null</code>
+ * @return the document footer. Never {@code null}
*/
Footer getFooter();
@@ -590,7 +590,7 @@ public interface Sheet extends Iterable<
*
* Note: multiple sheets can be selected, but only one sheet can be active at one time.
*
- * @param value <code>true</code> if this sheet is selected
+ * @param value {@code true} if this sheet is selected
* @see Workbook#setActiveSheet(int)
*/
void setSelected(boolean value);
@@ -620,7 +620,7 @@ public interface Sheet extends Iterable<
/**
* Sets the protection enabled as well as the password
- * @param password to set for protection. Pass <code>null</code> to remove protection
+ * @param password to set for protection. Pass {@code null} to remove protection
*/
void protectSheet(String password);
@@ -809,8 +809,8 @@ public interface Sheet extends Iterable<
* Sets a page break at the indicated row
* Breaks occur above the specified row and left of the specified column inclusive.
*
- * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts
- * with columns A,B,C in the first and D,E,... in the second. Similar, <code>sheet.setRowBreak(2);</code>
+ * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts
+ * with columns A,B,C in the first and D,E,... in the second. Similar, {@code sheet.setRowBreak(2);}
* breaks the sheet into two parts with first three rows (rownum=1...3) in the first part
* and rows starting with rownum=4 in the second.
*
@@ -847,8 +847,8 @@ public interface Sheet extends Iterable<
* Sets a page break at the indicated column.
* Breaks occur above the specified row and left of the specified column inclusive.
*
- * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts
- * with columns A,B,C in the first and D,E,... in the second. Similar, <code>sheet.setRowBreak(2);</code>
+ * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts
+ * with columns A,B,C in the first and D,E,... in the second. Similar, {@code sheet.setRowBreak(2);}
* breaks the sheet into two parts with first three rows (rownum=1...3) in the first part
* and rows starting with rownum=4 in the second.
*
@@ -958,7 +958,7 @@ public interface Sheet extends Iterable<
/**
* Returns cell comment for the specified location
*
- * @return cell comment or <code>null</code> if not found
+ * @return cell comment or {@code null} if not found
*/
Comment getCellComment(CellAddress ref);
@@ -1005,7 +1005,7 @@ public interface Sheet extends Iterable<
/**
* Note - this is not the same as whether the sheet is focused (isActive)
- * @return <code>true</code> if this sheet is currently selected
+ * @return {@code true} if this sheet is currently selected
*/
boolean isSelected();
@@ -1052,7 +1052,7 @@ public interface Sheet extends Iterable<
AutoFilter setAutoFilter(CellRangeAddress range);
/**
- * The 'Conditional Formatting' facet for this <tt>Sheet</tt>
+ * The 'Conditional Formatting' facet for this {@code Sheet}
*
* @return conditional formatting rule for this sheet
*/
@@ -1182,7 +1182,7 @@ public interface Sheet extends Iterable<
List<? extends Hyperlink> getHyperlinkList();
/**
- * Return location of the active cell, e.g. <code>A1</code>.
+ * Return location of the active cell, e.g. {@code A1}.
*
* @return the location of the active cell.
* @since 3.14beta1
@@ -1192,7 +1192,7 @@ public interface Sheet extends Iterable<
/**
* Sets location of the active cell
*
- * @param address the location of the active cell, e.g. <code>A1</code>.
+ * @param address the location of the active cell, e.g. {@code A1}.
* @since 3.14beta1
*/
void setActiveCell(CellAddress address);
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java Wed Apr 14 22:53:33 2021
@@ -23,7 +23,7 @@ import org.apache.poi.ss.usermodel.IconM
import org.apache.poi.ss.util.CellRangeAddress;
/**
- * The 'Conditional Formatting' facet of <tt>Sheet</tt>
+ * The 'Conditional Formatting' facet of {@code Sheet}
*
* @since 3.8
*/
@@ -88,7 +88,7 @@ public interface SheetConditionalFormatt
* </p>
*
* @param comparisonOperation - MUST be a constant value from
- * <tt>{@link ComparisonOperator}</tt>: <p>
+ * {@link ComparisonOperator}:
* <ul>
* <li>BETWEEN</li>
* <li>NOT_BETWEEN</li>
@@ -99,7 +99,6 @@ public interface SheetConditionalFormatt
* <li>GE</li>
* <li>LE</li>
* </ul>
- * </p>
* @param formula1 - formula for the valued, compared with the cell
* @param formula2 - second formula (only used with
* {@link ComparisonOperator#BETWEEN}) and {@link ComparisonOperator#NOT_BETWEEN} operations)
@@ -117,7 +116,7 @@ public interface SheetConditionalFormatt
* </p>
*
* @param comparisonOperation MUST be a constant value from
- * <tt>{@link ComparisonOperator}</tt> except BETWEEN and NOT_BETWEEN
+ * {@link ComparisonOperator} except BETWEEN and NOT_BETWEEN
*
* @param formula the formula to determine if the conditional formatting is applied
*/
@@ -138,20 +137,20 @@ public interface SheetConditionalFormatt
/**
* Create a Databar conditional formatting rule.
- * <p>The thresholds and colour for it will be created, but will be
- * empty and require configuring with
+ * <p>The thresholds and colour for it will be created, but will be
+ * empty and require configuring with
* {@link ConditionalFormattingRule#getDataBarFormatting()}
* then
* {@link DataBarFormatting#getMinThreshold()}
- * and
+ * and
* {@link DataBarFormatting#getMaxThreshold()}
*/
ConditionalFormattingRule createConditionalFormattingRule(ExtendedColor color);
-
+
/**
* Create an Icon Set / Multi-State conditional formatting rule.
* <p>The thresholds for it will be created, but will be empty
- * and require configuring with
+ * and require configuring with
* {@link ConditionalFormattingRule#getMultiStateFormatting()}
* then
* {@link IconMultiStateFormatting#getThresholds()}
@@ -160,8 +159,8 @@ public interface SheetConditionalFormatt
/**
* Create a Color Scale / Color Gradient conditional formatting rule.
- * <p>The thresholds and colours for it will be created, but will be
- * empty and require configuring with
+ * <p>The thresholds and colours for it will be created, but will be
+ * empty and require configuring with
* {@link ConditionalFormattingRule#getColorScaleFormatting()}
* then
* {@link ColorScaleFormatting#getThresholds()}
@@ -169,12 +168,12 @@ public interface SheetConditionalFormatt
* {@link ColorScaleFormatting#getColors()}
*/
ConditionalFormattingRule createConditionalFormattingColorScaleRule();
-
+
/**
* Gets Conditional Formatting object at a particular index
*
* @param index 0-based index of the Conditional Formatting object to fetch
- * @return Conditional Formatting object or <code>null</code> if not found
+ * @return Conditional Formatting object or {@code null} if not found
* @throws IllegalArgumentException if the index is outside of the allowable range (0 ... numberOfFormats-1)
*/
ConditionalFormatting getConditionalFormattingAt(int index);
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java Wed Apr 14 22:53:33 2021
@@ -26,22 +26,22 @@ import org.apache.poi.util.StringUtil;
public class AreaReference {
- /** The character (!) that separates sheet names from cell references */
+ /** The character (!) that separates sheet names from cell references */
private static final char SHEET_NAME_DELIMITER = '!';
/** The character (:) that separates the two cell references in a multi-cell area reference */
private static final char CELL_DELIMITER = ':';
/** The character (') used to quote sheet names when they contain special characters */
private static final char SPECIAL_NAME_DELIMITER = '\'';
private static final SpreadsheetVersion DEFAULT_SPREADSHEET_VERSION = SpreadsheetVersion.EXCEL97;
-
+
private final CellReference _firstCell;
private final CellReference _lastCell;
private final boolean _isSingleCell;
private final SpreadsheetVersion _version; // never null
-
+
/**
* Create an area ref from a string representation. Sheet names containing special characters should be
- * delimited and escaped as per normal syntax rules for formulas.<br>
+ * delimited and escaped as per normal syntax rules for formulas.<br>
* The area reference must be contiguous (i.e. represent a single rectangle, not a union of rectangles)
*/
public AreaReference(String reference, SpreadsheetVersion version) {
@@ -58,7 +58,7 @@ public class AreaReference {
// TODO - probably shouldn't initialize area ref when text is really a cell ref
// Need to fix some named range stuff to get rid of this
_firstCell = new CellReference(part0);
-
+
_lastCell = _firstCell;
_isSingleCell = true;
return;
@@ -66,7 +66,7 @@ public class AreaReference {
if (parts.length != 2) {
throw new IllegalArgumentException("Bad area ref '" + reference + "'");
}
-
+
String part1 = parts[1];
if (isPlainColumn(part0)) {
if (!isPlainColumn(part1)) {
@@ -78,10 +78,10 @@ public class AreaReference {
boolean firstIsAbs = CellReference.isPartAbsolute(part0);
boolean lastIsAbs = CellReference.isPartAbsolute(part1);
-
+
int col0 = CellReference.convertColStringToIndex(part0);
int col1 = CellReference.convertColStringToIndex(part1);
-
+
_firstCell = new CellReference(0, col0, true, firstIsAbs);
_lastCell = new CellReference(0xFFFF, col1, true, lastIsAbs);
_isSingleCell = false;
@@ -92,7 +92,7 @@ public class AreaReference {
_isSingleCell = part0.equals(part1);
}
}
-
+
/**
* Creates an area ref from a pair of Cell References.
*/
@@ -145,7 +145,7 @@ public class AreaReference {
}
_isSingleCell = false;
}
-
+
private static boolean isPlainColumn(String refPart) {
for(int i=refPart.length()-1; i>=0; i--) {
int ch = refPart.charAt(i);
@@ -190,9 +190,9 @@ public class AreaReference {
*/
public static boolean isWholeColumnReference(SpreadsheetVersion version, CellReference topLeft, CellReference botRight) {
if (null == version) {
- version = DEFAULT_SPREADSHEET_VERSION; // how the code used to behave.
+ version = DEFAULT_SPREADSHEET_VERSION; // how the code used to behave.
}
-
+
// These are represented as something like
// C$1:C$65535 or D$1:F$0
// i.e. absolute from 1st row to 0th one
@@ -222,7 +222,7 @@ public class AreaReference {
* Separates Area refs in two parts and returns them as separate elements in a String array,
* each qualified with the sheet name (if present)
*
- * @return array with one or two elements. never <code>null</code>
+ * @return array with one or two elements. never {@code null}
*/
private static String[] separateAreaRefs(String reference) {
// TODO - refactor cell reference parsing logic to one place.
@@ -322,13 +322,13 @@ public class AreaReference {
}
return results.toArray(new String[0]);
}
-
+
public boolean isWholeColumnReference() {
return isWholeColumnReference(_version, _firstCell, _lastCell);
}
-
+
/**
- * @return <code>false</code> if this area reference involves more than one cell
+ * @return {@code false} if this area reference involves more than one cell
*/
public boolean isSingleCell() {
return _isSingleCell;
@@ -344,7 +344,7 @@ public class AreaReference {
/**
* Note - if this area reference refers to a single cell, the return value of this method will
- * be identical to that of <tt>getFirstCell()</tt>
+ * be identical to that of {@code getFirstCell()}
* @return the second cell reference which defines this area. For multi-cell areas, this is
* cell diagonally opposite the 'first cell'. Usually this cell is in the lower right corner
* of the area (but this is not a requirement).
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java Wed Apr 14 22:53:33 2021
@@ -26,11 +26,11 @@ import org.apache.poi.ss.usermodel.Cell;
* It is barely a container for these two coordinates. The implementation
* of the Comparable interface sorts by "natural" order top left to bottom right.</p>
*
- * <p>Use <tt>CellAddress</tt> when you want to refer to the location of a cell in a sheet
+ * <p>Use {@code CellAddress} when you want to refer to the location of a cell in a sheet
* when the concept of relative/absolute does not apply (such as the anchor location
* of a cell comment). Use {@link CellReference} when the concept of
* relative/absolute does apply (such as a cell reference in a formula).
- * <tt>CellAddress</tt>es do not have a concept of "sheet", while <tt>CellReference</tt>s do.</p>
+ * {@code CellAddress}es do not have a concept of "sheet", while {@code CellReference}s do.</p>
*/
public class CellAddress implements Comparable<CellAddress> {
/** A constant for references to the first cell in a sheet. */
@@ -127,7 +127,6 @@ public class CellAddress implements Comp
* Compare this CellAddress using the "natural" row-major, column-minor ordering.
* That is, top-left to bottom-right ordering.
*
- * @param other
* @return <ul>
* <li>-1 if this CellAddress is before (above/left) of other</li>
* <li>0 if addresses are the same</li>
@@ -137,16 +136,8 @@ public class CellAddress implements Comp
@Override
public int compareTo(CellAddress other) {
int r = this._row-other._row;
- if (r!=0) {
- return r;
- }
-
- r = this._col-other._col;
- if (r!=0) {
- return r;
- }
+ return r != 0 ? r : this._col - other._col;
- return 0;
}
@Override
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java Wed Apr 14 22:53:33 2021
@@ -29,7 +29,6 @@ import org.apache.poi.util.LittleEndianO
* Ref8U - see page 831 of version 1.0 of the documentation.
*
* Note - {@link SelectionRecord} uses the BIFF5 version of this structure
- * @author Dragos Buleandra (dragos.buleandra@trade2b.ro)
*/
public class CellRangeAddress extends CellRangeAddressBase {
public static final int ENCODED_SIZE = 8;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java Wed Apr 14 22:53:33 2021
@@ -37,20 +37,19 @@ import org.apache.poi.util.LittleEndianO
* several records (not formulas). A cell range address list consists of a field
* with the number of ranges and the list of the range addresses. Each cell
* range address (called an ADDR structure) contains 4 16-bit-values.
- * </p>
*/
public class CellRangeAddressList implements GenericRecord {
/**
- * List of <tt>CellRangeAddress</tt>es. Each structure represents a cell range
+ * List of {@code CellRangeAddress}es. Each structure represents a cell range
*/
protected final List<CellRangeAddress> _list = new ArrayList<>();
public CellRangeAddressList() {
}
/**
- * Convenience constructor for creating a <tt>CellRangeAddressList</tt> with a single
- * <tt>CellRangeAddress</tt>. Other <tt>CellRangeAddress</tt>es may be added later.
+ * Convenience constructor for creating a {@code CellRangeAddressList} with a single
+ * {@code CellRangeAddress}. Other {@code CellRangeAddress}es may be added later.
*/
public CellRangeAddressList(int firstRow, int lastRow, int firstCol, int lastCol) {
addCellRangeAddress(firstRow, firstCol, lastRow, lastCol);
@@ -104,7 +103,7 @@ public class CellRangeAddressList implem
}
/**
- * @return <tt>CellRangeAddress</tt> at the given index
+ * @return {@code CellRangeAddress} at the given index
*/
public CellRangeAddress getCellRangeAddress(int index) {
return _list.get(index);
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellReference.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellReference.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellReference.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellReference.java Wed Apr 14 22:53:33 2021
@@ -38,12 +38,12 @@ import org.apache.poi.util.GenericRecord
* style references. Handles sheet-based and sheet-free references
* as well, eg "Sheet1!A1" and "$B$72"</p>
*
- * <p>Use <tt>CellReference</tt> when the concept of
+ * <p>Use {@code CellReference} when the concept of
* relative/absolute does apply (such as a cell reference in a formula).
* Use {@link CellAddress} when you want to refer to the location of a cell in a sheet
* when the concept of relative/absolute does not apply (such as the anchor location
* of a cell comment).
- * <tt>CellReference</tt>s have a concept of "sheet", while <tt>CellAddress</tt>es do not.</p>
+ * {@code CellReference}s have a concept of "sheet", while {@code CellAddress}es do not.</p>
*/
public class CellReference implements GenericRecord {
/**
@@ -177,7 +177,7 @@ public class CellReference implements Ge
public boolean isRowAbsolute(){return _isRowAbs;}
public boolean isColAbsolute(){return _isColAbs;}
/**
- * @return possibly <code>null</code> if this is a 2D reference. Special characters are not
+ * @return possibly {@code null} if this is a 2D reference. Special characters are not
* escaped or delimited
*/
public String getSheetName(){
@@ -216,7 +216,7 @@ public class CellReference implements Ge
/**
* Classifies an identifier as either a simple (2D) cell reference or a named range name
- * @return one of the values from <tt>NameType</tt>
+ * @return one of the values from {@code NameType}
*/
public static NameType classifyCellReference(String str, SpreadsheetVersion ssVersion) {
int len = str.length();
@@ -290,7 +290,6 @@ public class CellReference implements Ge
* reference is valid (in range) becomes important.
* <p>
* Note - that the maximum sheet size varies across Excel versions:
- * <p>
* <blockquote><table border="0" cellpadding="1" cellspacing="0"
* summary="Notable cases.">
* <tr><th>Version </th><th>File Format </th>
@@ -317,7 +316,7 @@ public class CellReference implements Ge
*
* @param colStr a string of only letter characters
* @param rowStr a string of only digit characters
- * @return <code>true</code> if the row and col parameters are within range of a BIFF8 spreadsheet.
+ * @return {@code true} if the row and col parameters are within range of a BIFF8 spreadsheet.
*/
public static boolean cellReferenceIsWithinRange(String colStr, String rowStr, SpreadsheetVersion ssVersion) {
if (!isColumnWithinRange(colStr, ssVersion)) {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java Wed Apr 14 22:53:33 2021
@@ -44,12 +44,9 @@ import org.apache.poi.ss.usermodel.Workb
* style change to a cell, the code will attempt to see if a style already exists that meets your
* needs. If not, then it will create a new style. This is to prevent creating too many styles.
* there is an upper limit in Excel on the number of styles that can be supported.
- *
- *@author Eric Pugh epugh@upstate.com
- *@author (secondary) Avinash Kewalramani akewalramani@accelrys.com
*/
public final class CellUtil {
-
+
private static final Logger LOGGER = LogManager.getLogger(CellUtil.class);
// FIXME: Move these constants into an enum
@@ -73,7 +70,7 @@ public final class CellUtil {
public static final String ROTATION = "rotation";
public static final String VERTICAL_ALIGNMENT = "verticalAlignment";
public static final String WRAP_TEXT = "wrapText";
-
+
private static final Set<String> shortValues = Collections.unmodifiableSet(
new HashSet<>(Arrays.asList(
BOTTOM_BORDER_COLOR,
@@ -87,8 +84,8 @@ public final class CellUtil {
ROTATION
)));
private static final Set<String> intValues = Collections.unmodifiableSet(
- new HashSet<>(Arrays.asList(
- FONT
+ new HashSet<>(Collections.singletonList(
+ FONT
)));
private static final Set<String> booleanValues = Collections.unmodifiableSet(
new HashSet<>(Arrays.asList(
@@ -105,7 +102,7 @@ public final class CellUtil {
)));
- private static UnicodeMapping[] unicodeMappings;
+ private static final UnicodeMapping[] unicodeMappings;
private static final class UnicodeMapping {
@@ -190,7 +187,7 @@ public final class CellUtil {
/**
* Take a cell, and align it.
- *
+ *
* This is superior to cell.getCellStyle().setAlignment(align) because
* this method will not modify the CellStyle object that may be referenced
* by multiple cells. Instead, this method will search for existing CellStyles
@@ -206,10 +203,10 @@ public final class CellUtil {
public static void setAlignment(Cell cell, HorizontalAlignment align) {
setCellStyleProperty(cell, ALIGNMENT, align);
}
-
+
/**
* Take a cell, and vertically align it.
- *
+ *
* This is superior to cell.getCellStyle().setVerticalAlignment(align) because
* this method will not modify the CellStyle object that may be referenced
* by multiple cells. Instead, this method will search for existing CellStyles
@@ -225,13 +222,13 @@ public final class CellUtil {
public static void setVerticalAlignment(Cell cell, VerticalAlignment align) {
setCellStyleProperty(cell, VERTICAL_ALIGNMENT, align);
}
-
+
/**
* Take a cell, and apply a font to it
*
* @param cell the cell to set the alignment for
* @param font The Font that you want to set.
- * @throws IllegalArgumentException if <tt>font</tt> and <tt>cell</tt> do not belong to the same workbook
+ * @throws IllegalArgumentException if {@code font} and {@code cell} do not belong to the same workbook
*/
public static void setFont(Cell cell, Font font) {
// Check if font belongs to workbook
@@ -248,19 +245,19 @@ public final class CellUtil {
}
/**
- * <p>This method attempts to find an existing CellStyle that matches the <code>cell</code>'s
- * current style plus styles properties in <code>properties</code>. A new style is created if the
+ * <p>This method attempts to find an existing CellStyle that matches the {@code cell}'s
+ * current style plus styles properties in {@code properties}. A new style is created if the
* workbook does not contain a matching style.</p>
- *
- * <p>Modifies the cell style of <code>cell</code> without affecting other cells that use the
+ *
+ * <p>Modifies the cell style of {@code cell} without affecting other cells that use the
* same style.</p>
- *
+ *
* <p>This is necessary because Excel has an upper limit on the number of styles that it supports.</p>
- *
+ *
* <p>This function is more efficient than multiple calls to
* {@link #setCellStyleProperty(Cell, String, Object)}
* if adding multiple cell styles.</p>
- *
+ *
* <p>For performance reasons, if this is the only cell in a workbook that uses a cell style,
* this method does NOT remove the old style from the workbook.
* <!-- NOT IMPLEMENTED: Unused styles should be
@@ -304,18 +301,18 @@ public final class CellUtil {
}
/**
- * <p>This method attempts to find an existing CellStyle that matches the <code>cell</code>'s
- * current style plus a single style property <code>propertyName</code> with value
- * <code>propertyValue</code>.
+ * <p>This method attempts to find an existing CellStyle that matches the {@code cell}'s
+ * current style plus a single style property {@code propertyName} with value
+ * {@code propertyValue}.
* A new style is created if the workbook does not contain a matching style.</p>
- *
- * <p>Modifies the cell style of <code>cell</code> without affecting other cells that use the
+ *
+ * <p>Modifies the cell style of {@code cell} without affecting other cells that use the
* same style.</p>
- *
+ *
* <p>If setting more than one cell style property on a cell, use
* {@link #setCellStyleProperties(Cell, Map)},
* which is faster and does not add unnecessary intermediate CellStyles to the workbook.</p>
- *
+ *
* @param cell The cell that is to be changed.
* @param propertyName The name of the property that is to be changed.
* @param propertyValue The value of the property that is to be changed.
@@ -327,8 +324,8 @@ public final class CellUtil {
/**
* Returns a map containing the format properties of the given cell style.
- * The returned map is not tied to <code>style</code>, so subsequent changes
- * to <code>style</code> will not modify the map, and changes to the returned
+ * The returned map is not tied to {@code style}, so subsequent changes
+ * to {@code style} will not modify the map, and changes to the returned
* map will not modify the cell style. The returned map is mutable.
*
* @param style cell style
@@ -359,7 +356,7 @@ public final class CellUtil {
put(properties, WRAP_TEXT, style.getWrapText());
return properties;
}
-
+
/**
* Copies the entries in src to dest, using the preferential data type
* so that maps can be compared for equality
@@ -452,7 +449,7 @@ public final class CellUtil {
}
return 0;
}
-
+
/**
* Utility method that returns the named BorderStyle value from the given map.
*
@@ -469,7 +466,7 @@ public final class CellUtil {
// @deprecated 3.15 beta 2. getBorderStyle will only work on BorderStyle enums instead of codes in the future.
else if (value instanceof Short) {
LOGGER.atWarn().log("Deprecation warning: CellUtil properties map uses Short values for {}. Should use BorderStyle enums instead.", name);
- short code = ((Short) value).shortValue();
+ short code = (Short) value;
border = BorderStyle.valueOf(code);
}
else if (value == null) {
@@ -480,7 +477,7 @@ public final class CellUtil {
}
return border;
}
-
+
/**
* Utility method that returns the named FillPatternType value from the given map.
*
@@ -498,7 +495,7 @@ public final class CellUtil {
// @deprecated 3.15 beta 2. getFillPattern will only work on FillPatternType enums instead of codes in the future.
else if (value instanceof Short) {
LOGGER.atWarn().log("Deprecation warning: CellUtil properties map uses Short values for {}. Should use FillPatternType enums instead.", name);
- short code = ((Short) value).shortValue();
+ short code = (Short) value;
pattern = FillPatternType.forInt(code);
}
else if (value == null) {
@@ -509,7 +506,7 @@ public final class CellUtil {
}
return pattern;
}
-
+
/**
* Utility method that returns the named HorizontalAlignment value from the given map.
*
@@ -527,7 +524,7 @@ public final class CellUtil {
// @deprecated 3.15 beta 2. getHorizontalAlignment will only work on HorizontalAlignment enums instead of codes in the future.
else if (value instanceof Short) {
LOGGER.atWarn().log("Deprecation warning: CellUtil properties map used a Short value for {}. Should use HorizontalAlignment enums instead.", name);
- short code = ((Short) value).shortValue();
+ short code = (Short) value;
align = HorizontalAlignment.forInt(code);
}
else if (value == null) {
@@ -538,7 +535,7 @@ public final class CellUtil {
}
return align;
}
-
+
/**
* Utility method that returns the named VerticalAlignment value from the given map.
*
@@ -556,7 +553,7 @@ public final class CellUtil {
// @deprecated 3.15 beta 2. getVerticalAlignment will only work on VerticalAlignment enums instead of codes in the future.
else if (value instanceof Short) {
LOGGER.atWarn().log("Deprecation warning: CellUtil properties map used a Short value for {}. Should use VerticalAlignment enums instead.", name);
- short code = ((Short) value).shortValue();
+ short code = (Short) value;
align = VerticalAlignment.forInt(code);
}
else if (value == null) {
@@ -580,7 +577,7 @@ public final class CellUtil {
Object value = properties.get(name);
//noinspection SimplifiableIfStatement
if (value instanceof Boolean) {
- return ((Boolean) value).booleanValue();
+ return (Boolean) value;
}
return false;
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java Wed Apr 14 22:53:33 2021
@@ -29,10 +29,8 @@ import static org.apache.poi.ss.util.IEE
* <br>
* where:<br>
*
- * <tt>a</tt> = <i>significand</i><br>
- * <tt>b</tt> = <i>binaryExponent</i> - bitLength(significand) + 1<br>
- *
- * @author Josh Micich
+ * {@code a} = <i>significand</i><br>
+ * {@code b} = <i>binaryExponent</i> - bitLength(significand) + 1<br>
*/
final class ExpandedDouble {
private static final BigInteger BI_FRAC_MASK = BigInteger.valueOf(FRAC_MASK);
@@ -60,7 +58,7 @@ final class ExpandedDouble {
BigInteger frac = BigInteger.valueOf(rawBits).and(BI_FRAC_MASK);
int expAdj = 64 - frac.bitLength();
_significand = frac.shiftLeft(expAdj);
- _binaryExponent = (biasedExp & 0x07FF) - 1023 - expAdj;
+ _binaryExponent = -1023 - expAdj;
} else {
_significand = getFrac(rawBits);
_binaryExponent = (biasedExp & 0x07FF) - 1023;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java Wed Apr 14 22:53:33 2021
@@ -20,8 +20,6 @@ package org.apache.poi.ss.util;
/**
* For working with the internals of IEEE 754-2008 'binary64' (double precision) floating point numbers
- *
- * @author Josh Micich
*/
final class IEEEDouble {
private static final long EXPONENT_MASK = 0x7FF0000000000000L;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java Wed Apr 14 22:53:33 2021
@@ -38,9 +38,7 @@ import java.math.BigInteger;
* <br>
* where:<br>
*
- * <tt>significand</tt> = wholePart + fractionalPart / 2<sup>24</sup><br>
- *
- * @author Josh Micich
+ * {@code significand} = wholePart + fractionalPart / 2<sup>24</sup><br>
*/
final class NormalisedDecimal {
/**
@@ -168,10 +166,10 @@ final class NormalisedDecimal {
* The resulting transformed object is easily converted to a 64 bit IEEE double:
* <ul>
* <li>bits 2-53 of the {@link #composeFrac()} become the 52 bit 'fraction'.</li>
- * <li>{@link #getBinaryExponent()} is biased by 1023 to give the 'exponent'.</li>
+ * <li>{@link #getDecimalExponent()} is biased by 1023 to give the 'exponent'.</li>
* </ul>
* The sign bit must be obtained from somewhere else.
- * @return a new {@link NormalisedDecimal} normalised to base 2 representation.
+ * @return a new NormalisedDecimal normalised to base 2 representation.
*/
public ExpandedDouble normaliseBaseTwo() {
MutableFPNumber cc = new MutableFPNumber(composeFrac(), 39);
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java Wed Apr 14 22:53:33 2021
@@ -24,9 +24,6 @@ import static org.apache.poi.ss.util.IEE
/**
* Excel compares numbers using different rules to those of java, so
* {@link Double#compare(double, double)} won't do.
- *
- *
- * @author Josh Micich
*/
public final class NumberComparer {
@@ -37,10 +34,9 @@ public final class NumberComparer {
* decimal digits of precision and a decimal exponent, before completing the comparison.
* <p>
* In Excel formula evaluation, expressions like "(0.06-0.01)=0.05" evaluate to "TRUE" even
- * though the equivalent java expression is <code>false</code>. In examples like this,
+ * though the equivalent java expression is {@code false}. In examples like this,
* Excel achieves the effect by having additional logic for comparison operations.
* <p>
- * <p>
* Note - Excel also gives special treatment to expressions like "0.06-0.01-0.05" which
* evaluates to "0" (in java, rounding anomalies give a result of 6.9E-18). The special
* behaviour here is for different reasons to the example above: If the last operator in a
@@ -55,8 +51,8 @@ public final class NumberComparer {
* This rule (for rounding the result of a final addition or subtraction), has not been
* implemented in POI (as of Jul-2009).
*
- * @return <code>negative, 0, or positive</code> according to the standard Excel comparison
- * of values <tt>a</tt> and <tt>b</tt>.
+ * @return {@code negative, 0, or positive} according to the standard Excel comparison
+ * of values {@code a} and {@code b}.
*/
public static int compare(double a, double b) {
long rawBitsA = Double.doubleToLongBits(a);
@@ -142,7 +138,7 @@ public final class NumberComparer {
* Usually any normal number is greater (in magnitude) than any subnormal number.
* However there are some anomalous cases around the threshold where Excel produces screwy results
* @param isNegative both values are either negative or positive. This parameter affects the sign of the comparison result
- * @return usually <code>isNegative ? -1 : +1</code>
+ * @return usually {@code isNegative ? -1 : +1}
*/
private static int compareAcrossSubnormalThreshold(long normalRawBitsA, long subnormalRawBitsB, boolean isNegative) {
long fracB = subnormalRawBitsB & FRAC_MASK;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org