import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.ss.util.NumberToTextConverter;
-import org.apache.poi.util.Internal;
import org.apache.poi.util.LocaleUtil;
import org.apache.poi.util.Removal;
break;
case NUMERIC :
- NumberRecord nrec = null;
+ NumberRecord nrec;
if (cellType != _cellType)
{
break;
case BLANK :
- BlankRecord brec = null;
+ BlankRecord brec;
if (cellType != _cellType)
{
break;
case BOOLEAN :
- BoolErrRecord boolRec = null;
+ BoolErrRecord boolRec;
if (cellType != _cellType)
{
break;
case ERROR :
- BoolErrRecord errRec = null;
+ BoolErrRecord errRec;
if (cellType != _cellType)
{
if (_cellType != CellType.STRING) {
setCellType(CellType.STRING, false, row, col, styleIndex);
}
- int index = 0;
+ int index;
HSSFRichTextString hvalue = (HSSFRichTextString) value;
UnicodeString str = hvalue.getUnicodeString();
* on the cached value of the formula
*
* @since POI 4.0
- * @return <code>CellType</code> depending
- * on the cached value of the formula
*/
@Override
public CellType getCachedFormulaResultType() {
}
public boolean isPartOfArrayFormulaGroup() {
- if (_cellType != CellType.FORMULA) {
- return false;
- }
- return ((FormulaRecordAggregate)_record).isPartOfArrayFormula();
+ return _cellType == CellType.FORMULA && ((FormulaRecordAggregate) _record).isPartOfArrayFormula();
}
/**
* Case sensitivity: all names are case-insensitive
*
* Uniqueness: must be unique (for names with the same scope)
- *
- * @param name
*/
private static void validateName(String name) {
}
public String toString() {
- StringBuffer sb = new StringBuffer(64);
- sb.append(getClass().getName()).append(" [");
- sb.append(_definedNameRec.getNameText());
- sb.append("]");
- return sb.toString();
+ return getClass().getName() + " [" +
+ _definedNameRec.getNameText() +
+ "]";
}
/**
* Common conversion functions between Excel style A1, C27 style
* cell references, and POI usermodel style row=0, column=0
* style references.
+ *
+ * @deprecated POI 4.0.0-SNAPSHOT. Use {@link org.apache.poi.ss.util.CellReference} instead.
+ * Actually the replacement CellReference was added earlier, but the deprecation notice
+ * was added only in 4.0.0-SNAPSHOT.
*/
public final class CellReference extends org.apache.poi.ss.util.CellReference {
/**
}
public String toString() {
- StringBuffer sb = new StringBuffer(64);
- sb.append(getClass().getName()).append(" [");
- sb.append(formatAsString());
- sb.append("]");
- return sb.toString();
+ return getClass().getName() + " [" +
+ formatAsString() +
+ "]";
}
public String formatAsString() {
* the cell and also its cell type. This method should be preferred over
* evaluateInCell() when the call should not modify the contents of the
* original cell.
- * @param cell
+ * @param cell The {@link Cell} to evaluate
*/
CellValue evaluate(Cell cell);
* Be aware that your cell value will be changed to hold the
* result of the formula. If you simply want the formula
* value computed for you, use {@link #evaluateFormulaCell(Cell)}
- * @param cell
+ * @param cell The {@link Cell} to evaluate and modify.
*/
Cell evaluateInCell(Cell cell);