/** * Is the reference for a whole-column reference, * such as C:C or D:G ? */ public static boolean isWholeColumnReference(SpreadsheetVersion version, CellReference topLeft, CellReference botRight) { if (null == version) { 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 return (topLeft.getRow() == 0 && topLeft.isRowAbsolute() && botRight.getRow() == version.getLastRowIndex() && botRight.isRowAbsolute()); } public boolean isWholeColumnReference() {
/** * Returns a reference to every cell covered by this area */ public CellReference[] getAllReferencedCells() { // Special case for single cell reference if(_isSingleCell) { return new CellReference[] { _firstCell, }; } // Interpolate between the two int minRow = Math.min(_firstCell.getRow(), _lastCell.getRow()); int maxRow = Math.max(_firstCell.getRow(), _lastCell.getRow()); int minCol = Math.min(_firstCell.getCol(), _lastCell.getCol()); int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol()); String sheetName = _firstCell.getSheetName(); List<CellReference> refs = new ArrayList<>(); for(int row=minRow; row<=maxRow; row++) { for(int col=minCol; col<=maxCol; col++) { CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute()); refs.add(ref); } } return refs.toArray(new CellReference[refs.size()]); }
protected RefPtgBase(CellReference c) { setRow(c.getRow()); setColumn(c.getCol()); setColRelative(!c.isColAbsolute()); setRowRelative(!c.isRowAbsolute()); }
if (swapRows) { firstRow = botRight.getRow(); firstRowAbs = botRight.isRowAbsolute(); lastRow = topLeft.getRow(); lastRowAbs = topLeft.isRowAbsolute(); } else { firstRow = topLeft.getRow(); firstRowAbs = topLeft.isRowAbsolute(); lastRow = botRight.getRow(); lastRowAbs = botRight.isRowAbsolute();
protected AreaPtgBase(AreaReference ar) { CellReference firstCell = ar.getFirstCell(); CellReference lastCell = ar.getLastCell(); setFirstRow(firstCell.getRow()); setFirstColumn(firstCell.getCol() == -1 ? 0 : firstCell.getCol()); setLastRow(lastCell.getRow()); setLastColumn(lastCell.getCol() == -1 ? 0xFF : lastCell.getCol()); setFirstColRelative(!firstCell.isColAbsolute()); setLastColRelative(!lastCell.isColAbsolute()); setFirstRowRelative(!firstCell.isRowAbsolute()); setLastRowRelative(!lastCell.isRowAbsolute()); }
/** * Is the reference for a whole-column reference, * such as C:C or D:G ? */ public static boolean isWholeColumnReference(CellReference topLeft, CellReference botRight) { // These are represented as something like // C$1:C$65535 or D$1:F$0 // i.e. absolute from 1st row to 0th one if(topLeft.getRow() == 0 && topLeft.isRowAbsolute() && botRight.getRow() == SpreadsheetVersion.EXCEL97.getLastRowIndex() && botRight.isRowAbsolute()) { return true; } return false; } public boolean isWholeColumnReference() {
/** * Is the reference for a whole-column reference, * such as C:C or D:G ? */ public static boolean isWholeColumnReference(CellReference topLeft, CellReference botRight) { // These are represented as something like // C$1:C$65535 or D$1:F$0 // i.e. absolute from 1st row to 0th one if(topLeft.getRow() == 0 && topLeft.isRowAbsolute() && botRight.getRow() == SpreadsheetVersion.EXCEL97.getLastRowIndex() && botRight.isRowAbsolute()) { return true; } return false; } public boolean isWholeColumnReference() {
/** * Is the reference for a whole-column reference, * such as C:C or D:G ? */ public static boolean isWholeColumnReference(SpreadsheetVersion version, CellReference topLeft, CellReference botRight) { if (null == version) { 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 return (topLeft.getRow() == 0 && topLeft.isRowAbsolute() && botRight.getRow() == version.getLastRowIndex() && botRight.isRowAbsolute()); } public boolean isWholeColumnReference() {
/** * Returns a reference to every cell covered by this area */ public CellReference[] getAllReferencedCells() { // Special case for single cell reference if(_isSingleCell) { return new CellReference[] { _firstCell, }; } // Interpolate between the two int minRow = Math.min(_firstCell.getRow(), _lastCell.getRow()); int maxRow = Math.max(_firstCell.getRow(), _lastCell.getRow()); int minCol = Math.min(_firstCell.getCol(), _lastCell.getCol()); int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol()); String sheetName = _firstCell.getSheetName(); List<CellReference> refs = new ArrayList<>(); for(int row=minRow; row<=maxRow; row++) { for(int col=minCol; col<=maxCol; col++) { CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute()); refs.add(ref); } } return refs.toArray(new CellReference[refs.size()]); }
/** * Returns a reference to every cell covered by this area */ public CellReference[] getAllReferencedCells() { // Special case for single cell reference if(_isSingleCell) { return new CellReference[] { _firstCell, }; } // Interpolate between the two int minRow = Math.min(_firstCell.getRow(), _lastCell.getRow()); int maxRow = Math.max(_firstCell.getRow(), _lastCell.getRow()); int minCol = Math.min(_firstCell.getCol(), _lastCell.getCol()); int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol()); String sheetName = _firstCell.getSheetName(); ArrayList refs = new ArrayList(); for(int row=minRow; row<=maxRow; row++) { for(int col=minCol; col<=maxCol; col++) { CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute()); refs.add(ref); } } return (CellReference[])refs.toArray(new CellReference[refs.size()]); }
/** * Returns a reference to every cell covered by this area */ public CellReference[] getAllReferencedCells() { // Special case for single cell reference if(_isSingleCell) { return new CellReference[] { _firstCell, }; } // Interpolate between the two int minRow = Math.min(_firstCell.getRow(), _lastCell.getRow()); int maxRow = Math.max(_firstCell.getRow(), _lastCell.getRow()); int minCol = Math.min(_firstCell.getCol(), _lastCell.getCol()); int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol()); String sheetName = _firstCell.getSheetName(); ArrayList refs = new ArrayList(); for(int row=minRow; row<=maxRow; row++) { for(int col=minCol; col<=maxCol; col++) { CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute()); refs.add(ref); } } return (CellReference[])refs.toArray(new CellReference[refs.size()]); }
protected RefPtgBase(CellReference c) { setRow(c.getRow()); setColumn(c.getCol()); setColRelative(!c.isColAbsolute()); setRowRelative(!c.isRowAbsolute()); }
protected RefPtgBase(CellReference c) { setRow(c.getRow()); setColumn(c.getCol()); setColRelative(!c.isColAbsolute()); setRowRelative(!c.isRowAbsolute()); }
protected RefPtgBase(CellReference c) { setRow(c.getRow()); setColumn(c.getCol()); setColRelative(!c.isColAbsolute()); setRowRelative(!c.isRowAbsolute()); }
if (swapRows) { firstRow = botRight.getRow(); firstRowAbs = botRight.isRowAbsolute(); lastRow = topLeft.getRow(); lastRowAbs = topLeft.isRowAbsolute(); } else { firstRow = topLeft.getRow(); firstRowAbs = topLeft.isRowAbsolute(); lastRow = botRight.getRow(); lastRowAbs = botRight.isRowAbsolute();
if (swapRows) { firstRow = botRight.getRow(); firstRowAbs = botRight.isRowAbsolute(); lastRow = topLeft.getRow(); lastRowAbs = topLeft.isRowAbsolute(); } else { firstRow = topLeft.getRow(); firstRowAbs = topLeft.isRowAbsolute(); lastRow = botRight.getRow(); lastRowAbs = botRight.isRowAbsolute();
if (swapRows) { firstRow = botRight.getRow(); firstRowAbs = botRight.isRowAbsolute(); lastRow = topLeft.getRow(); lastRowAbs = topLeft.isRowAbsolute(); } else { firstRow = topLeft.getRow(); firstRowAbs = topLeft.isRowAbsolute(); lastRow = botRight.getRow(); lastRowAbs = botRight.isRowAbsolute();
protected AreaPtgBase(AreaReference ar) { CellReference firstCell = ar.getFirstCell(); CellReference lastCell = ar.getLastCell(); setFirstRow(firstCell.getRow()); setFirstColumn(firstCell.getCol() == -1 ? 0 : firstCell.getCol()); setLastRow(lastCell.getRow()); setLastColumn(lastCell.getCol() == -1 ? 0xFF : lastCell.getCol()); setFirstColRelative(!firstCell.isColAbsolute()); setLastColRelative(!lastCell.isColAbsolute()); setFirstRowRelative(!firstCell.isRowAbsolute()); setLastRowRelative(!lastCell.isRowAbsolute()); }
protected AreaPtgBase(AreaReference ar) { CellReference firstCell = ar.getFirstCell(); CellReference lastCell = ar.getLastCell(); setFirstRow(firstCell.getRow()); setFirstColumn(firstCell.getCol() == -1 ? 0 : firstCell.getCol()); setLastRow(lastCell.getRow()); setLastColumn(lastCell.getCol() == -1 ? 0xFF : lastCell.getCol()); setFirstColRelative(!firstCell.isColAbsolute()); setLastColRelative(!lastCell.isColAbsolute()); setFirstRowRelative(!firstCell.isRowAbsolute()); setLastRowRelative(!lastCell.isRowAbsolute()); }
protected AreaPtgBase(AreaReference ar) { CellReference firstCell = ar.getFirstCell(); CellReference lastCell = ar.getLastCell(); setFirstRow(firstCell.getRow()); setFirstColumn(firstCell.getCol() == -1 ? 0 : firstCell.getCol()); setLastRow(lastCell.getRow()); setLastColumn(lastCell.getCol() == -1 ? 0xFF : lastCell.getCol()); setFirstColRelative(!firstCell.isColAbsolute()); setLastColRelative(!lastCell.isColAbsolute()); setFirstRowRelative(!firstCell.isRowAbsolute()); setLastRowRelative(!lastCell.isRowAbsolute()); }