com.spire.xls
Class CellRange

java.lang.Object
  extended by com.spire.xls.core.spreadsheet.XlsObject
      extended by com.spire.xls.core.spreadsheet.XlsRange
          extended by com.spire.xls.CellRange
All Implemented Interfaces:
ICombinedRange, IXLSRange, java.lang.Iterable

public class CellRange
extends XlsRange

Represents the cell range.


Constructor Summary
CellRange(java.lang.Object parent)
           
CellRange(java.lang.Object parent, int firstCol, int firstRow, int lastCol, int lastRow)
           
 
Method Summary
 CellRange activate()
          Active single cell in the worksheet.
 ExcelComment addComment()
          Adds a comment to the range.
 void addComment(ExcelComment comment)
          Adds a comment to the range.
 CellRange copy(CellRange destRange)
          Copies the range to the specified range.
 CellRange copy(CellRange destRange, boolean updateReference)
          Copies the range to the specified range.
 CellRange copy(CellRange destRange, boolean updateReference, boolean copyStyles)
          Copies the range to the specified range.
 CellRange copy(CellRange destRange, java.util.EnumSet<CopyRangeOptions> copyOptions)
          Copies the range to the specified range.
 CellRange deepClone(java.lang.Object parent, java.util.HashMap rangeNames, Workbook book)
          Clones current IXLSRange.
 CellRange[] findAllBool(boolean boolValue)
          Finds the cell with the input bool.
 CellRange[] findAllDate(java.util.Date dateValue)
          Finds the cell with the input datetime.
 CellRange[] findAllNumber(double doubleValue, boolean formulaValue)
          Finds the cell with the input double.
 CellRange[] findAllString(java.lang.String stringValue, boolean formula, boolean formulaValue)
          Finds the cell with the input string.
 CellRange findBool(boolean boolValue)
          Finds the cell with the input bool.
 CellRange findDate(java.util.Date dateValue)
          Finds the cell with the input datetime.
 CellRange findNumber(double doubleValue, boolean formulaValue)
          Finds the cell with the input double.
 CellRange findString(java.lang.String stringValue, boolean formula, boolean formulaValue)
          Finds the cell with the input string.
 CellRange get(int row, int column)
          Gets cell range.
 CellRange get(int row, int column, int lastRow, int lastColumn)
          Gets cell range.
 CellRange get(java.lang.String name)
          Gets cell range.
 CellRange get(java.lang.String name, boolean IsR1C1Notation)
          Gets cell range
 BordersCollection getBorders()
          Returns a borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).
 java.util.ArrayList<CellRange> getCellList()
          Returns a Range object that represents the cells in the specified range.
 CellStyle getCellStyle()
          Returns a style object that represents the style of the specified range
 CellRange[] getColumns()
          Returns a range object that represents the columns in the specified range
 ExcelComment getComment()
          Returns a comment object that represents the comment associated with the cell in the upper-left corner of the range.
 CellRange getEndCell()
          Returns a range object that represents the cell at the end of the region that contains the source range.
 CellRange getEntireColumn()
          Returns a range object that represents the entire column (or columns) that contains the specified range.
 CellRange getEntireRow()
          Returns a range object that represents the entire row (or rows) that contains the specified range.
 CellRange getMergeArea()
          Returns a range object that represents the merged range containing the specified cell.
 RichText getRichText()
          Returns a rich text string object that represents the rich text style.
 CellRange[] getRows()
          Returns the number of the first row of the first area in the range.
 Worksheet getWorksheet()
          Returns a worksheet object that represents the worksheet
 CellRange intersect(CellRange range)
          Get intersection range with the specified range.
 CellRange merge(CellRange range)
          Creates a merged cell from the specified Range object.
 void move(CellRange destRange)
          Moves the cells to the specified Range.
 void move(CellRange destRange, boolean copyStyle, boolean updateReference)
          Moves the cells to the specified Range.
 void set(int row, int column, CellRange value)
          Gets cell range.
 void setDataValidation(Validation dataValidation)
          Sets data validation for the range.
 void setStyle(CellStyle value)
          Returns a style object that represents the style of the specified range
 
Methods inherited from class com.spire.xls.core.spreadsheet.XlsRange
activate, addCombinedRange, addComment, autoFitColumns, autoFitRows, borderAround, borderAround, borderAround, borderAround, borderInside, borderInside, borderInside, borderInside, borderNone, clear, clearAll, clearConditionalFormats, clearContents, collapseGroup, convertToNumber, deepClone, dispose, expandGroup, freezePanes, getBooleanValue, getBuiltInStyle, getCellsCount, getCellStyleName, getColumn, getColumnCount, getColumnGroupLevel, getColumnWidth, getConditionalFormats, getCount, getDataValidation, getDateTimeValue, getDisplayedText, getEnvalutedValue, getErrorValue, getExtendedFormatIndex, getFormula, getFormulaArray, getFormulaArrayR1C1, getFormulaBoolValue, getFormulaDateTime, getFormulaErrorValue, getFormulaNumberValue, getFormulaR1C1, getFormulaStringValue, getFormulaValue, getHorizontalAlignment, getHtmlString, getHyperlinks, getIgnoreErrorOptions, getIndentLevel, getLastColumn, getLastRow, getNewRangeLocation, getNumberFormat, getNumberText, getNumberValue, getParent, getRangeAddress, getRangeAddressLocal, getRangeGlobalAddress, getRangeGlobalAddress2007, getRangeGlobalAddressWithoutSheetName, getRangeR1C1Address, getRangeR1C1AddressLocal, getRectangles, getRow, getRowCount, getRowGroupLevel, getRowHeight, getStyle, getText, getValue, getValue2, getVerticalAlignment, getWorksheetName, groupByColumns, groupByRows, hasBoolean, hasComment, hasConditionFormats, hasDataValidation, hasDateTime, hasError, hasExternalFormula, hasFormula, hasFormulaArray, hasFormulaBoolValue, hasFormulaDateTime, hasFormulaErrorValue, hasFormulaNumberValue, hasFormulaStringValue, hasMerged, hasNumber, hasPictures, hasRichText, hasString, hasStyle, intersect, isAllNumber, isBlank, isFormulaHidden, isFormulaHidden, isGroupedByColumn, isGroupedByRow, isInitialized, isStringsPreserved, isStringsPreserved, isWrapText, isWrapText, iterator, measureString, merge, merge, merge, partialClear, replace, replace, replace, replace, replace, replace, replace, replace, set, setBooleanValue, setBuiltInStyle, setCellStyleName, setColumnWidth, setDataValidation, setDateTimeValue, setDateTimeValue, setErrorValue, setExtendedFormatIndex, setExtendedFormatIndexs, setFormula, setFormulaArray, setFormulaArrayR1C1, setFormulaBoolValue, setFormulaDateTime, setFormulaErrorValue, setFormulaNumberValue, setFormulaR1C1, setFormulaStringValue, setHorizontalAlignment, setHtmlString, setIgnoreErrorOptions, setIndentLevel, setLastColumn, setLastRow, setNumberFormat, setNumberValue, setObjectValue, setRowHeight, setRowHeight, setStyle, setText, setValue, setVerticalAlignment, ungroupByColumns, ungroupByRows, unMerge, updateRange
 
Methods inherited from interface com.spire.xls.core.ICombinedRange
getRectanglesCount
 
Methods inherited from interface com.spire.xls.core.IXLSRange
expandGroup, getInnerFormulaDateTime, getTimeSpanValue
 

Constructor Detail

CellRange

public CellRange(java.lang.Object parent)

CellRange

public CellRange(java.lang.Object parent,
                 int firstCol,
                 int firstRow,
                 int lastCol,
                 int lastRow)
Method Detail

activate

public CellRange activate()
Active single cell in the worksheet.

Overrides:
activate in class XlsRange
Returns:
CellRange

addComment

public void addComment(ExcelComment comment)
Adds a comment to the range.

Parameters:
comment - Comment to add.

addComment

public ExcelComment addComment()
Adds a comment to the range.

Specified by:
addComment in interface IXLSRange
Overrides:
addComment in class XlsRange
Returns:
Created comment or exists one.

deepClone

public CellRange deepClone(java.lang.Object parent,
                           java.util.HashMap rangeNames,
                           Workbook book)
Clones current IXLSRange.

Parameters:
parent - Parent object.
rangeNames - new names.
book - Parent workbook.
Returns:
Cloned instance.

move

public void move(CellRange destRange)
Moves the cells to the specified Range.

Parameters:
destRange - Destnation range.

move

public void move(CellRange destRange,
                 boolean copyStyle,
                 boolean updateReference)
Moves the cells to the specified Range.

Parameters:
destRange - Destination range.
copyStyle - Copy style
updateReference - Indicates whether to update reference range.

copy

public CellRange copy(CellRange destRange)
Copies the range to the specified range.

Parameters:
destRange - Destination range
Returns:
Destination range

copy

public CellRange copy(CellRange destRange,
                      boolean updateReference)
Copies the range to the specified range.

Parameters:
destRange - Destination range.
updateReference - Indicates whether to update reference cells.
Returns:
Destination range

copy

public CellRange copy(CellRange destRange,
                      boolean updateReference,
                      boolean copyStyles)
Copies the range to the specified range.

Parameters:
destRange - Destination range.
updateReference - Indicates whether to update reference cells
copyStyles - Indicates whether to copy styles.
Returns:
Destination range

copy

public CellRange copy(CellRange destRange,
                      java.util.EnumSet<CopyRangeOptions> copyOptions)
Copies the range to the specified range.

Parameters:
destRange - Destination range.
copyOptions - Copy options.
Returns:

findAllNumber

public CellRange[] findAllNumber(double doubleValue,
                                 boolean formulaValue)
Finds the cell with the input double.

Parameters:
doubleValue - Double value to search for
formulaValue - Indicates whether to find formula value
Returns:
Found ranges

findAllString

public CellRange[] findAllString(java.lang.String stringValue,
                                 boolean formula,
                                 boolean formulaValue)
Finds the cell with the input string.

Parameters:
stringValue - String value to search for
formula - Indicates whether include formula
formulaValue - Indicates whether include formula value
Returns:
Found ranges

findAllDate

public CellRange[] findAllDate(java.util.Date dateValue)
Finds the cell with the input datetime.

Parameters:
dateValue - Date time value to search for
Returns:
Found ranges

findAllBool

public CellRange[] findAllBool(boolean boolValue)
Finds the cell with the input bool.

Parameters:
boolValue - Bool value to search for
Returns:
Found ranges

findBool

public CellRange findBool(boolean boolValue)
Finds the cell with the input bool.

Parameters:
boolValue - Bool value to search for
Returns:
Found range

findNumber

public CellRange findNumber(double doubleValue,
                            boolean formulaValue)
Finds the cell with the input double.

Parameters:
doubleValue - Double value to search for
formulaValue - Indicates whether includes formula value to search for
Returns:
Found range

findString

public CellRange findString(java.lang.String stringValue,
                            boolean formula,
                            boolean formulaValue)
Finds the cell with the input string.

Parameters:
stringValue - String value to search for
formula - Indicates whether includes formula to search for
formulaValue - Indicates whether includes formula value to search for
Returns:
Found range

findDate

public CellRange findDate(java.util.Date dateValue)
Finds the cell with the input datetime.

Parameters:
dateValue - Datetime value to search for
Returns:
Found range

intersect

public CellRange intersect(CellRange range)
Get intersection range with the specified range.

Parameters:
range - Range which to intersect.
Returns:
Range intersection.

merge

public CellRange merge(CellRange range)
Creates a merged cell from the specified Range object.

Parameters:
range - The range to merge with.
Returns:
Merged ranges.

setDataValidation

public void setDataValidation(Validation dataValidation)
Sets data validation for the range.

Parameters:
dataValidation - Data validation to set.

getBorders

public BordersCollection getBorders()
Returns a borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).

Specified by:
getBorders in interface IXLSRange
Overrides:
getBorders in class XlsRange
Returns:

getCellStyle

public CellStyle getCellStyle()
Returns a style object that represents the style of the specified range

Returns:
Cell style

setStyle

public void setStyle(CellStyle value)
Returns a style object that represents the style of the specified range


getCellList

public java.util.ArrayList<CellRange> getCellList()
Returns a Range object that represents the cells in the specified range.

Specified by:
getCellList in interface IXLSRange
Overrides:
getCellList in class XlsRange
Returns:

getColumns

public CellRange[] getColumns()
Returns a range object that represents the columns in the specified range

Specified by:
getColumns in interface IXLSRange
Overrides:
getColumns in class XlsRange
Returns:

getRows

public CellRange[] getRows()
Returns the number of the first row of the first area in the range.

Specified by:
getRows in interface IXLSRange
Overrides:
getRows in class XlsRange
Returns:
Cell range arrays

get

public CellRange get(int row,
                     int column)
Gets cell range. Row and column indexes are one-based.

Specified by:
get in interface IXLSRange
Overrides:
get in class XlsRange
Parameters:
row -
column -
Returns:
Cell range

set

public void set(int row,
                int column,
                CellRange value)
Gets cell range. Row and column indexes are one-based.

Parameters:
row -
column -

get

public CellRange get(int row,
                     int column,
                     int lastRow,
                     int lastColumn)
Gets cell range. Row and column indexes are one-based.

Specified by:
get in interface IXLSRange
Overrides:
get in class XlsRange
Parameters:
row -
column -
lastRow -
lastColumn -
Returns:

get

public CellRange get(java.lang.String name)
Gets cell range.

Specified by:
get in interface IXLSRange
Overrides:
get in class XlsRange
Parameters:
name -
Returns:

get

public CellRange get(java.lang.String name,
                     boolean IsR1C1Notation)
Gets cell range

Specified by:
get in interface IXLSRange
Overrides:
get in class XlsRange
Parameters:
name -
IsR1C1Notation -
Returns:

getComment

public ExcelComment getComment()
Returns a comment object that represents the comment associated with the cell in the upper-left corner of the range.

Specified by:
getComment in interface IXLSRange
Overrides:
getComment in class XlsRange
Returns:
Excel comment

getWorksheet

public Worksheet getWorksheet()
Returns a worksheet object that represents the worksheet

Specified by:
getWorksheet in interface IXLSRange
Overrides:
getWorksheet in class XlsRange
Returns:
containing the specified range.

getRichText

public RichText getRichText()
Returns a rich text string object that represents the rich text style.

Specified by:
getRichText in interface IXLSRange
Overrides:
getRichText in class XlsRange
Returns:

getEntireColumn

public CellRange getEntireColumn()
Returns a range object that represents the entire column (or columns) that contains the specified range.

Specified by:
getEntireColumn in interface IXLSRange
Overrides:
getEntireColumn in class XlsRange
Returns:

getEndCell

public CellRange getEndCell()
Returns a range object that represents the cell at the end of the region that contains the source range.

Specified by:
getEndCell in interface IXLSRange
Overrides:
getEndCell in class XlsRange
Returns:
Cell range

getMergeArea

public CellRange getMergeArea()
Returns a range object that represents the merged range containing the specified cell.

Specified by:
getMergeArea in interface IXLSRange
Overrides:
getMergeArea in class XlsRange
Returns:
Cell range

getEntireRow

public CellRange getEntireRow()
Returns a range object that represents the entire row (or rows) that contains the specified range.

Specified by:
getEntireRow in interface IXLSRange
Overrides:
getEntireRow in class XlsRange
Returns: