public interface Range
Modifier and Type | Interface and Description |
---|---|
static class |
Range.AutoFillType
AutoFillType attributes, that can be applied.
|
static class |
Range.AutoFilterOperator
AutoFilterOperator attributes, that can be applied.
|
static class |
Range.DeleteShiftDirection
DeleteShiftDirection attributes, that can be applied.
|
static class |
Range.InsertFormatOrigin
InsertFormatOrigin attributes, that can be applied.
|
static class |
Range.InsertShiftDirection
InsertShiftDirection attributes, that can be applied.
|
static class |
Range.PasteSpecialOperation
PasteSpecialOperation attributes, that can be applied.
|
static class |
Range.PasteType
PasteType attributes, that can be applied.
|
static class |
Range.SortDataOption
SortDataOption attributes, that can be applied.
|
static class |
Range.SortOrder
SortOrder attributes, that can be applied.
|
static class |
Range.SortOrientation
SortOrientation attributes, that can be applied.
|
static class |
Range.YesNoGuess
YesNoGuess attributes, that can be applied.
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_COL
The maximum column size.
|
static int |
MAX_ROW
The maximum row size.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Select a cell or cells with this range.
|
void |
clear()
Clears the formulas/values/formats of this range.
|
void |
clearAutoFilter()
Clears the auto filter
|
void |
clearCellStyle()
Clears the cell style.
|
void |
clearContents()
Clears a formula/values of this range
|
void |
clearDataValidation()
Clears the data validation
|
void |
clearHyperlinks()
Clears the hyperlink from this range.
|
void |
copyTo(Range dest)
Copies this range to the destination
|
Borders |
createBorders()
Creates the borders with (
Borders.BorderIndex.EdgeLeft ,
Borders.BorderIndex.EdgeTop , and Borders.BorderIndex.EdgeBottom ,
Borders.BorderIndex.EdgeRight ) |
Borders |
createBorders(Borders.BorderIndex borderIndex)
Creates the borders from the given border index.
|
CellStyle |
createCellStyle()
Creates a cell style object.
|
DataValidation |
createDataValidation()
Creates a data validation
|
Font |
createFont()
Creates a font
|
Hyperlink |
createHyperlink()
Creates a hyperlink.
|
Fill.PatternFill |
createPatternFill()
Creates a pattern fill.
|
void |
cutTo(Range dest)
Cuts and pastes the range to the destination
|
void |
delete(Range.DeleteShiftDirection deleteShiftDirection)
Deletes cells of the range.
|
void |
freezePanes()
freeze the panes from the given range.
|
String |
getA1Notation()
Returns the A1 notation from this range, e.g.
|
Range |
getCell(int row,
int column)
Returns the range from the cell position.
|
CellStyle |
getCellStyle()
Returns the cell style.
|
int |
getColumn()
Returns the left column position for this range, 0-based.
|
Range |
getColumns()
Return the column part of this range.
|
Range |
getColumns(int index)
Returns a Range that is n-th column(0-based) related to the first area of
this range and in the range.
|
double |
getColumnWidth()
Returns the column width of this range in character unit width.
|
int |
getColumnWidthPx()
Returns the column width of this range in pixels.
|
int |
getCount()
Returns the count of cells of this range.
|
List<DataValidationValue> |
getDataValidations()
Returns the data validations.
|
Range |
getEntireColumn()
Returns a Range that represents the entire column (or columns)
that contains this range.
|
Range |
getEntireRow()
Returns a Range that represents the entire row (or rows) that
contains this range.
|
Hyperlink |
getHyperlink()
Returns the hyperlink.
|
int |
getLastColumn()
Returns the end column position for this range, 0-based.
|
int |
getLastRow()
Returns the end row position for this range, 0-based.
|
<T> RangeValue<T> |
getRangeValue()
Returns the first range value from this range.
|
<T> List<RangeValue<T>> |
getRangeValues()
Returns the range values from this range as a List.
|
<T> List<List<RangeValue<T>>> |
getRangeValuesMatrix()
Returns the range values from this range as a matrix(List of List, rows then columns).
|
<T> List<List<RangeValue<T>>> |
getRegionRangeValuesMatrix()
Returns the range values from the region, the minimum outline area that contains this
range, as a matrix(List of List, rows then columns)
|
<T> List<List<T>> |
getRegionValuesMatrix()
Returns the values from the region, the minimum outline area that contains this
range, as a matrix(List of List, rows then columns).
|
int |
getRow()
Returns the top row position for this range, 0-based.
|
double |
getRowHeight()
Returns the row height of this range in character unit height.
|
int |
getRowHeightPx()
Returns the row height of this range in pixels.
|
Range |
getRows()
Returns the row port of this range.
|
Range |
getRows(int index)
Returns a Range that is n-th row(0-based) related to the first area of
this range and in the range.
|
int |
getSheetOrder()
Returns the sheet index of this range.
|
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet.
|
<T> T |
getValue()
Returns the first value from this range.
|
<T> List<T> |
getValues()
Returns the values from this range as a List.
|
<T> List<List<T>> |
getValuesMatrix()
Returns the values from this range as a matrix(List of List, rows then columns).
|
Workbook |
getWorkbook()
Returns the workbook which holds this range.
|
Worksheet |
getWorksheet()
Returns the worksheet which holds this range.
|
void |
insert(Range.InsertShiftDirection insertShiftDirection,
Range.InsertFormatOrigin insertFormatOrigin)
Insert cells to the range
|
boolean |
isHidden()
Returns whether rows/columns is hidden; note this range must be either rows or
columns.
|
void |
merge(boolean across)
Merges the range
|
void |
pasteSpecial(Range dest,
Range.PasteType type,
Range.PasteSpecialOperation op,
boolean skipBlanks,
boolean transpose)
Pastes a range to the destination range
|
void |
setAutoFill(Range dest,
Range.AutoFillType fillType)
According to current range, fills data to destination range automatically
|
void |
setAutoFilter(int field,
Object criteria1,
Range.AutoFilterOperator operator,
Object criteria2,
boolean visibleDropDown)
Sets the auto filter to this range.
|
void |
setBorders(Borders borders)
Sets the borders for this range.
|
void |
setCellStyle(CellStyle cellStyle)
Sets the cell style.
|
void |
setColumnWidth(double width)
Sets the column width of this range in character unit width.
|
void |
setColumnWidthPx(int width)
Sets the column width of this range in pixels.
|
void |
setDataValidation(DataValidation dataValidation)
Sets the data dataValidation
|
void |
setFill(Fill fill)
Sets the fill to this range.
|
void |
setFont(Font font)
Sets the font to this range.
|
void |
setHidden(boolean hidden)
Sets whether rows/columns is hidden; note this range must be either rows or
columns.
|
void |
setHorizontalAlignment(Alignment.Horizontal alignment)
Sets the horizontal alignment for the given range.
|
void |
setHyperlink(Hyperlink hyperlink)
Sets the given hyperlink to this range.
|
void |
setNumberFormat(String format)
Sets the number format to this range.
|
void |
setRowHeight(double height)
Sets the row height of this range in character unit height.
|
void |
setRowHeightPx(int height)
Sets the row height of this range in pixels.
|
void |
setSheetOrder(int index)
Applies the sheet order to the given index.
|
<T> void |
setValue(T value)
Sets the range value.
|
<T> void |
setValues(T... values)
Sets the range values.
|
void |
setVerticalAlignment(Alignment.Vertical alignment)
Sets the vertical alignment.
|
void |
setWrapText(boolean wrapText)
Sets to enable or disable the wrap text.
|
void |
sort(Range key1,
Range.SortOrder order1,
Range key2,
Range.SortOrder order2,
Range key3,
Range.SortOrder order3,
Range.YesNoGuess header,
boolean matchCase,
Range.SortOrientation orientation,
Range.SortDataOption dataOption1,
Range.SortDataOption dataOption2,
Range.SortDataOption dataOption3)
Sort values in this range with given options.
|
void |
unfreezePanes()
un-freeze the panes.
|
void |
unmerge()
Unmerge the range.
|
static final int MAX_COL
static final int MAX_ROW
Spreadsheet getSpreadsheet()
Workbook getWorkbook()
Worksheet getWorksheet()
<T> RangeValue<T> getRangeValue()
<T> T getValue()
RangeValue.getValue()
.getRangeValue()
<T> List<RangeValue<T>> getRangeValues()
<T> List<List<RangeValue<T>>> getRangeValuesMatrix()
<T> List<List<RangeValue<T>>> getRegionRangeValuesMatrix()
<T> List<T> getValues()
getRangeValues()
<T> List<List<T>> getValuesMatrix()
getRangeValuesMatrix()
<T> List<List<T>> getRegionValuesMatrix()
getRegionRangeValuesMatrix()
Range getCell(int row, int column)
String getA1Notation()
int getRow()
int getColumn()
int getLastRow()
int getLastColumn()
<T> void setValue(T value)
value
- Number|String<T> void setValues(T... values)
values
- a list of Number|Stringvoid setVerticalAlignment(Alignment.Vertical alignment)
alignment
- either Alignment.Vertical.Top
, Alignment.Vertical.Center
,
Alignment.Vertical.Bottom
, Alignment.Vertical.Justify
, or Alignment.Vertical.Distributed
void setHorizontalAlignment(Alignment.Horizontal alignment)
Borders createBorders(Borders.BorderIndex borderIndex)
Borders.BorderIndex.EdgeLeft
,
Borders.BorderIndex.EdgeTop
, and Borders.BorderIndex.EdgeBottom
,
Borders.BorderIndex.EdgeRight
) at the same time.Borders createBorders()
Borders.BorderIndex.EdgeLeft
,
Borders.BorderIndex.EdgeTop
, and Borders.BorderIndex.EdgeBottom
,
Borders.BorderIndex.EdgeRight
)void setBorders(Borders borders)
borders
- void setWrapText(boolean wrapText)
wrapText
- void delete(Range.DeleteShiftDirection deleteShiftDirection)
deleteShiftDirection
- the shift direction when deleting. either Range.DeleteShiftDirection.ShiftUp
or Range.DeleteShiftDirection.ShiftToLeft
void insert(Range.InsertShiftDirection insertShiftDirection, Range.InsertFormatOrigin insertFormatOrigin)
insertShiftDirection
- the shift direction off original cells. Either
Range.InsertShiftDirection.ShiftDown
or
Range.InsertShiftDirection.ShiftToRight
insertFormatOrigin
- copy the format from nearby cells when inserting new cells. Either
Range.InsertFormatOrigin.LeftOrAbove
or
Range.InsertFormatOrigin.RightOrBelow
void setColumnWidth(double width)
width
- double getColumnWidth()
void setColumnWidthPx(int width)
width
- int getColumnWidthPx()
void setRowHeight(double height)
height
- double getRowHeight()
void setRowHeightPx(int height)
height
- int getRowHeightPx()
void activate()
void clearContents()
Range getColumns()
getColumns(int)
Range getColumns(int index)
Range getRows()
getRows(int)
Range getRows(int index)
int getCount()
Range getEntireRow()
Range getEntireColumn()
void setAutoFilter(int field, Object criteria1, Range.AutoFilterOperator operator, Object criteria2, boolean visibleDropDown)
field
- The integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field onecriteria1
- The criteria (a string; for example, "101"). Use "=" to find blank fields, or use "<>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").operator
- either Range.AutoFilterOperator.And
, Range.AutoFilterOperator.Bottom10Items
,
Range.AutoFilterOperator.Bottom10Percent
, Range.AutoFilterOperator.FilterCellColor
,
Range.AutoFilterOperator.FilterDynamic
, Range.AutoFilterOperator.FilterFontColor
,
Range.AutoFilterOperator.FilterIcon
, Range.AutoFilterOperator.FilterValues
,
Range.AutoFilterOperator.Top10Items
, or Range.AutoFilterOperator.Top10Percent
criteria2
- The second criteria (a string). Used with Criteria1 and Operator to construct compound criteria.visibleDropDown
- True to display the AutoFilter drop-down arrow for the filtered field.
False to hide the AutoFilter drop-down arrow for the filtered field. True by default.void clearAutoFilter()
int getSheetOrder()
CellStyle getCellStyle()
CellStyle createCellStyle()
void setCellStyle(CellStyle cellStyle)
cellStyle
- void clearCellStyle()
void setNumberFormat(String format)
format
- Font createFont()
void setFont(Font font)
font
- Fill.PatternFill createPatternFill()
void setFill(Fill fill)
fill
- DataValidation createDataValidation()
void setDataValidation(DataValidation dataValidation)
dataValidation
- void clearDataValidation()
List<DataValidationValue> getDataValidations()
Hyperlink createHyperlink()
void setHyperlink(Hyperlink hyperlink)
hyperlink
- void clearHyperlinks()
Hyperlink getHyperlink()
void clear()
void merge(boolean across)
across
- true if merge horizontally onlyvoid unmerge()
void copyTo(Range dest)
dest
- the destinationvoid cutTo(Range dest)
dest
- the destinationvoid pasteSpecial(Range dest, Range.PasteType type, Range.PasteSpecialOperation op, boolean skipBlanks, boolean transpose)
dest
- the destinationtype
- the paste typeop
- the paste operationskipBlanks
- skip blanks or nottranspose
- transpose the cell or notvoid setHidden(boolean hidden)
hidden
- true to hideboolean isHidden()
void setSheetOrder(int index)
index
- 0-basedvoid freezePanes()
void unfreezePanes()
void setAutoFill(Range dest, Range.AutoFillType fillType)
void sort(Range key1, Range.SortOrder order1, Range key2, Range.SortOrder order2, Range key3, Range.SortOrder order3, Range.YesNoGuess header, boolean matchCase, Range.SortOrientation orientation, Range.SortDataOption dataOption1, Range.SortDataOption dataOption2, Range.SortDataOption dataOption3)
key1
- the first range that is sorted onorder1
- the sortOrder for key1key2
- the 2nd range that is sorted on, if any.order2
- the sortOrder for key2key3
- the 3rd range that is sorted on, if any.order3
- the sortOrder for key3header
- the sort headermatchCase
- matches character chase of notorientation
- the sort orientation, if any.dataOption1
- data option 1 for sortdataOption2
- data option 2 for sortdataOption3
- data option 3 for sortCopyright © 2018. All rights reserved.