ColumnRange3d(String s,
ExternalSheet es) throws FormulaException {
super(es);
workbook = es;
int seppos = s.lastIndexOf(":");
Assert.verify(seppos != -1);
String startcell = s.substring(0, seppos);
String endcell = s.substring(seppos + 1);
// Get the the start cell details
int sep = s.indexOf('!");
String cellString = s.substring(sep + 1, seppos);
int columnFirst = CellReferenceHelper.getColumn(cellString);
int rowFirst = 0;
// Get the sheet index
String sheetName = s.substring(0, sep);
int sheetNamePos = sheetName.lastIndexOf(']");
// Remove single quotes, if they exist
if (sheetName.charAt(0) == '\'" &&
sheetName.charAt(sheetName.length() - 1) == '\'")
{
sheetName = sheetName.substring(1, sheetName.length() - 1);
}
sheet = es.getExternalSheetIndex(sheetName);
if (sheet < 0)
{
throw new FormulaException(FormulaException.SHEET_REF_NOT_FOUND,
sheetName);
}
// Get the last cell index
int columnLast = CellReferenceHelper.getColumn(endcell);
int rowLast = 0xffff;
boolean columnFirstRelative = true;
boolean rowFirstRelative = true;
boolean columnLastRelative = true;
boolean rowLastRelative = true;
setRangeData(sheet, columnFirst, columnLast, rowFirst, rowLast,
columnFirstRelative, rowFirstRelative,
columnLastRelative, rowLastRelative);
}
Constructor invoked when parsing a string formula Parameters:
s - the string to parse
es - the external sheet
Throws:
FormulaException -
- exception:
FormulaException -
|