com.aspose.cells.Range.html Maven / Gradle / Ivy
Range
com.aspose.cells
Class Range
java.lang.Object
com.aspose.cells.Range
public class Range
- extends java.lang.Object
Property Getters/Setters Summary | ||
---|---|---|
java.lang.String | getAddress() | |
Gets address of the range. | ||
int | getCellCount() | |
Gets all cell count in the range. | ||
int | getColumnCount() | |
Gets the count of columns in the range. | ||
double | getColumnWidth() | |
void | setColumnWidth(double) | |
Sets or gets the column width of this range | ||
Range | getCurrentRegion() | |
Returns a Range object that represents the current region. The current region is a range bounded by any combination of blank rows and blank columns. | ||
Range | getEntireColumn() | |
Gets a Range object that represents the entire column (or columns) that contains the specified range. | ||
Range | getEntireRow() | |
Gets a Range object that represents the entire row (or rows) that contains the specified range. | ||
int | getFirstColumn() | |
Gets the index of the first column of the range. | ||
int | getFirstRow() | |
Gets the index of the first row of the range. | ||
com.aspose.cells.Hyperlink[] | getHyperlinks() | |
Gets all hyperlink in the range. | ||
java.lang.String | getName() | |
void | setName(java.lang.String) | |
Gets or sets the name of the range. | ||
java.lang.String | getRefersTo() | |
Gets the range's refers to. | ||
int | getRowCount() | |
Gets the count of rows in the range. | ||
double | getRowHeight() | |
void | setRowHeight(double) | |
Sets or gets the height of rows in this range | ||
java.lang.Object | getValue() | |
void | setValue(java.lang.Object) | |
Gets and sets the value of the range. | ||
Worksheet | getWorksheet() | |
Gets the |
||
Cell | get(int, int) | |
Gets |
Method Summary | ||
---|---|---|
void | applyStyle(Style style, StyleFlag flag) | |
Applies formats for a whole range. | ||
void | autoFill(Range target) | |
Automaticall fill the target range. | ||
void | autoFill(Range target, int autoFillType) | |
Automaticall fill the target range. | ||
void | copy(Range range) | |
Copies data (including formulas), formatting, drawing objects etc. from a source range. | ||
void | copy(Range range, PasteOptions options) | |
Copying the range with paste special options. | ||
void | copyData(Range range) | |
Copies cell data (including formulas) from a source range. | ||
void | copyStyle(Range range) | |
Copies style settings from a source range. | ||
void | copyValue(Range range) | |
Copies cell value from a source range. | ||
Cell | getCellOrNull(int rowOffset, int columnOffset) | |
Gets |
||
Range | getOffset(int rowOffset, int columnOffset) | |
Gets |
||
Range | intersect(Range range) | |
Returns a |
||
boolean | isIntersect(Range range) | |
Indicates whether the range is intersect. | ||
java.util.Iterator | iterator() | |
Gets the enumerator for cells in this Range. | ||
void | merge() | |
Combines a range of cells into a single cell. | ||
void | moveTo(int destRow, int destColumn) | |
Move the current range to the dest range. | ||
void | putValue(java.lang.String stringValue, boolean isConverted, boolean setStyle) | |
Puts a value into the range, if appropriate the value will be converted to other data type and cell's number format will be reset. | ||
void | setInsideBorders(int borderEdge, int lineStyle, CellsColor borderColor) | |
Set inside borders of the range. | ||
void | setOutlineBorder(int borderEdge, int borderStyle, com.aspose.cells.Color borderColor) | |
Sets outline border around a range of cells. | ||
void | setOutlineBorders(int borderStyle, com.aspose.cells.Color borderColor) | |
Sets the outline borders around a range of cells with same border style and color. | ||
void | setOutlineBorders(int[] borderStyles, com.aspose.cells.Color[] borderColors) | |
Sets out line borders around a range of cells. | ||
void | setStyle(Style style) | |
Sets the style of the range. | ||
java.lang.String | toString() | |
Returns a string represents the current Range object. | ||
java.util.ArrayList | union(Range range) | |
Returns the union of two ranges. | ||
void | unMerge() | |
Unmerges merged cells of this range. |
Property Getters/Setters Detail |
---|
getCurrentRegion | |
public Range getCurrentRegion() |
Returns a Range object that represents the current region. The current region is a range bounded by any combination of blank rows and blank columns.
getHyperlinks | |
public com.aspose.cells.Hyperlink[] getHyperlinks() |
Gets all hyperlink in the range.
getRowCount | |
public int getRowCount() |
Gets the count of rows in the range.
getColumnCount | |
public int getColumnCount() |
Gets the count of columns in the range.
getCellCount | |
public int getCellCount() |
Gets all cell count in the range. NOTE: This property is now obsolete. Instead, please use RowCount and ColumnCount to get total cells count. This property will be removed 12 months later since February 2021. Aspose apologizes for any inconvenience you may have experienced.
getName/setName | |
public java.lang.String getName() / public void setName(java.lang.String value) |
Gets or sets the name of the range. Named range is supported. For example, range.Name = "Sheet1!MyRange";
getRefersTo | |
public java.lang.String getRefersTo() |
Gets the range's refers to.
getAddress | |
public java.lang.String getAddress() |
Gets address of the range.
getFirstRow | |
public int getFirstRow() |
Gets the index of the first row of the range.
getFirstColumn | |
public int getFirstColumn() |
Gets the index of the first column of the range.
getValue/setValue | |
public java.lang.Object getValue() / public void setValue(java.lang.Object value) |
Gets and sets the value of the range. If the range contains multiple cells, return a two-dimension System.Array object. If applies object array to the range, it should be a two-dimensionSystem.Array object.
getColumnWidth/setColumnWidth | |
public double getColumnWidth() / public void setColumnWidth(double value) |
Sets or gets the column width of this range
getRowHeight/setRowHeight | |
public double getRowHeight() / public void setRowHeight(double value) |
Sets or gets the height of rows in this range
getEntireColumn | |
public Range getEntireColumn() |
Gets a Range object that represents the entire column (or columns) that contains the specified range.
getEntireRow | |
public Range getEntireRow() |
Gets a Range object that represents the entire row (or rows) that contains the specified range.
getWorksheet | |
public Worksheet getWorksheet() |
Gets the Worksheet object which contains this range.
get | |
public Cell get(int rowOffset, int columnOffset) |
Gets Cell object in this range.- Parameters:
rowOffset
- Row offset in this range, zero based.columnOffset
- Column offset in this range, zero based.
- Returns:
Cell object.
Method Detail |
---|
autoFill | |
public void autoFill(Range target) throws java.lang.Exception |
Automaticall fill the target range. - Parameters:
target
- the target range.
autoFill | |
public void autoFill(Range target, int autoFillType) throws java.lang.Exception |
Automaticall fill the target range. - Parameters:
target
- The targed range.autoFillType
- AAutoFillType value. The auto fill type.
iterator | |
public java.util.Iterator iterator() |
Gets the enumerator for cells in this Range. When traversing elements by the returned Enumerator, the cells collection should not be modified(such as operations that will cause new Cell/Row be instantiated or existing Cell/Row be deleted). Otherwise the enumerator may not be able to traverse all cells correctly(some elements may be traversed repeatedly or skipped). - Returns:
- The cells enumerator
isIntersect | |
public boolean isIntersect(Range range) |
Indicates whether the range is intersect. If the two ranges area not in the same worksheet ,return false. - Parameters:
range
- The range.
- Returns:
- Whether the range is intersect.
intersect | |
public Range intersect(Range range) |
Returns a Range object that represents the rectangular intersection of two ranges.If the two ranges are not intersected, returns null. - Parameters:
range
- The intersecting range.
- Returns:
- Returns a
Range object
union | |
public java.util.ArrayList union(Range range) |
Returns the union of two ranges. - Parameters:
range
- The range
- Returns:
- The union of two ranges.
merge | |
public void merge() |
Combines a range of cells into a single cell. Reference the merged cell via the address of the upper-left cell in the range.
unMerge | |
public void unMerge() |
Unmerges merged cells of this range.
putValue | |
public void putValue(java.lang.String stringValue, boolean isConverted, boolean setStyle) |
Puts a value into the range, if appropriate the value will be converted to other data type and cell's number format will be reset. - Parameters:
stringValue
- Input valueisConverted
- True: converted to other data type if appropriate.setStyle
- True: set the number format to cell's style when converting to other data type
applyStyle | |
public void applyStyle(Style style, StyleFlag flag) |
Applies formats for a whole range. Each cell in this range will contains a Style object. So this is a memory-consuming method. Please use it carefully.- Parameters:
style
- The style object which will be applied.flag
- Flags which indicates applied formatting properties.
setStyle | |
public void setStyle(Style style) |
Sets the style of the range. - Parameters:
style
- The Style object.
setOutlineBorders | |
public void setOutlineBorders(int borderStyle, com.aspose.cells.Color borderColor) |
Sets the outline borders around a range of cells with same border style and color. - Parameters:
borderStyle
- ACellBorderType value. Border style.borderColor
- Border color.
setOutlineBorders | |
public void setOutlineBorders(int[] borderStyles, com.aspose.cells.Color[] borderColors) |
Sets out line borders around a range of cells. Both the length of borderStyles and borderStyles must be 4. The order of borderStyles and borderStyles must be top,bottom,left,right - Parameters:
borderStyles
- Border styles.borderColors
- Border colors.
setOutlineBorder | |
public void setOutlineBorder(int borderEdge, int borderStyle, com.aspose.cells.Color borderColor) |
Sets outline border around a range of cells. - Parameters:
borderEdge
- ABorderType value. Border edge.borderStyle
- ACellBorderType value. Border style.borderColor
- Border color.
setInsideBorders | |
public void setInsideBorders(int borderEdge, int lineStyle, CellsColor borderColor) |
Set inside borders of the range. - Parameters:
borderEdge
- ABorderType value. Inside borde type, only can beBorderType.VERTICAL andBorderType.HORIZONTAL .lineStyle
- ACellBorderType value. The border style.borderColor
- The color of the border.
moveTo | |
public void moveTo(int destRow, int destColumn) |
Move the current range to the dest range. - Parameters:
destRow
- The start row of the dest range.destColumn
- The start column of the dest range.
copyData | |
public void copyData(Range range) throws java.lang.Exception |
Copies cell data (including formulas) from a source range. - Parameters:
range
- SourceRange object.
copyValue | |
public void copyValue(Range range) throws java.lang.Exception |
Copies cell value from a source range. - Parameters:
range
- SourceRange object.
copyStyle | |
public void copyStyle(Range range) |
Copies style settings from a source range. - Parameters:
range
- SourceRange object.
copy | |
public void copy(Range range, PasteOptions options) throws java.lang.Exception |
Copying the range with paste special options. - Parameters:
range
- The source range.options
- The paste special options.
copy | |
public void copy(Range range) throws java.lang.Exception |
Copies data (including formulas), formatting, drawing objects etc. from a source range. - Parameters:
range
- SourceRange object.
getCellOrNull | |
public Cell getCellOrNull(int rowOffset, int columnOffset) |
Gets Cell object or null in this range.- Parameters:
rowOffset
- Row offset in this range, zero based.columnOffset
- Column offset in this range, zero based.
- Returns:
Cell object.
getOffset | |
public Range getOffset(int rowOffset, int columnOffset) |
Gets Range range by offset.- Parameters:
rowOffset
- Row offset in this range, zero based.columnOffset
- Column offset in this range, zero based.
- Returns:
toString | |
public java.lang.String toString() |
Returns a string represents the current Range object. - Returns:
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.