public interface Range
Modifier and Type | Method and Description |
---|---|
Range |
activate()
Make this range the active range.
|
Range |
clear()
Clears the range of contents, formats, and data-validation rules.
|
void |
copyTo(Range destination)
Copies the data from a range of cells to another range of cells.
|
void |
forEach(CellVisitor callback)
Executes a provided function for each cell in the range
|
Range |
getCell(int row,
int column)
Returns a given cell within a range.
|
int |
getColumn()
Returns the starting column position for this range.
|
int |
getLastColumn()
Returns the end column position.
|
int |
getLastRow()
Returns the end row position.
|
int |
getNumColumns()
Returns the number of columns in this range.
|
int |
getNumRows()
Returns the number of rows in this range.
|
int |
getRow()
Returns the starting row position for this range.
|
CsvSheet |
getSheet()
Returns the sheet this range belongs to.
|
java.lang.Object |
getValue()
Returns the value of the top-left cell in the range.
|
java.lang.Object[][] |
getValues()
Returns the rectangular sheet of values for this range.
|
boolean |
isBlank()
Returns true if the range is totally empty.
|
void |
moveTo(Range destination)
Cut and paste the data from this range to the target range.
|
Range |
offset(int rowOffset,
int columnOffset)
Returns a new range that is offset from this range by the given number of rows and columns
(which can be negative).
|
Range |
offset(int rowOffset,
int columnOffset,
int numRows,
int numColumns)
Returns a new range that is relative to the current range, whose upper left point is offset
from the current range by the given rows and columns, and with the given height and width in
cells.
|
Range |
setValue(java.lang.Object value)
Sets the value of the range.
|
Range |
setValues(java.lang.Object[][] values)
Sets a rectangular sheet of values (must match dimensions of this range).
|
Range |
sort(java.lang.Object sortSpecObj)
Sorts the cells in a given range, by column and order specified.
|
Range activate()
Range clear()
Range getCell(int row, int column)
row
- the row of the cell relative to the rangecolumn
- the column of the cell relative to the rangeint getRow()
int getColumn()
int getLastRow()
int getLastColumn()
int getNumRows()
int getNumColumns()
CsvSheet getSheet()
java.lang.Object getValue()
java.lang.Object[][] getValues()
boolean isBlank()
void copyTo(Range destination)
destination
- a destination range to copy to; only the top-left cell position is relevantvoid moveTo(Range destination)
destination
- a destination range to copy to; only the top-left cell position is relevantRange offset(int rowOffset, int columnOffset)
rowOffset
- number of rows down from the range's top-left cell; negative values represent
rows up from the range's top-left cellcolumnOffset
- number of columns right from the range's top-left cell; negative values
represent columns left from the range's top-left cellRange offset(int rowOffset, int columnOffset, int numRows, int numColumns)
rowOffset
- number of rows down from the range's top-left cell; negative values represent
rows up from the range's top-left cellcolumnOffset
- number of columns right from the range's top-left cell; negative values
represent columns left from the range's top-left cellnumRows
- the height in rows of the new rangenumColumns
- the width in columns of the new rangeRange setValue(java.lang.Object value)
value
- the value for the rangeRange setValues(java.lang.Object[][] values)
values
- a two-dimensional array of valuesRange sort(java.lang.Object sortSpecObj)
sortSpecObj
- TODOvoid forEach(CellVisitor callback)
callback
- a callback function which will be called for each cell. See CellVisitor
for details.