public class AreaReference
extends java.lang.Object
Constructor and Description |
---|
AreaReference(CellReference topLeft,
CellReference botRight,
SpreadsheetVersion version)
Creates an area ref from a pair of Cell References.
|
AreaReference(java.lang.String reference,
SpreadsheetVersion version)
Create an area ref from a string representation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatAsString()
Returns a text representation of this area reference.
|
static AreaReference[] |
generateContiguous(SpreadsheetVersion version,
java.lang.String reference)
Takes a non-contiguous area reference, and returns an array of contiguous area references
|
CellReference[] |
getAllReferencedCells()
Returns a reference to every cell covered by this area
|
CellReference |
getFirstCell() |
CellReference |
getLastCell()
Note - if this area reference refers to a single cell, the return value of this method will
be identical to that of
getFirstCell() |
static AreaReference |
getWholeColumn(SpreadsheetVersion version,
java.lang.String start,
java.lang.String end)
Construct an AreaReference which spans one more columns.
|
static AreaReference |
getWholeRow(SpreadsheetVersion version,
java.lang.String start,
java.lang.String end)
Construct an AreaReference which spans one more rows
|
static boolean |
isContiguous(java.lang.String reference)
Is the reference for a contiguous (i.e.
|
boolean |
isSingleCell() |
boolean |
isWholeColumnReference() |
static boolean |
isWholeColumnReference(SpreadsheetVersion version,
CellReference topLeft,
CellReference botRight)
Is the reference for a whole-column reference,
such as C:C or D:G ?
|
java.lang.String |
toString() |
public AreaReference(java.lang.String reference, SpreadsheetVersion version)
public AreaReference(CellReference topLeft, CellReference botRight, SpreadsheetVersion version)
public static boolean isContiguous(java.lang.String reference)
generateContiguous(SpreadsheetVersion, String)
)public static AreaReference getWholeRow(SpreadsheetVersion version, java.lang.String start, java.lang.String end)
version
- Is the spreadsheet in format Excel97 or newer Excel versionsstart
- The 1-based start-index of the rowsend
- The 1-based end-index of the rowspublic static AreaReference getWholeColumn(SpreadsheetVersion version, java.lang.String start, java.lang.String end)
version
- Is the spreadsheet in format Excel97 or newer Excel versionsstart
- The ABC-based start-index of the columnsend
- The ABC-based end-index of the columnspublic static boolean isWholeColumnReference(SpreadsheetVersion version, CellReference topLeft, CellReference botRight)
public static AreaReference[] generateContiguous(SpreadsheetVersion version, java.lang.String reference)
public boolean isWholeColumnReference()
public boolean isSingleCell()
false
if this area reference involves more than one cellpublic CellReference getFirstCell()
public CellReference getLastCell()
getFirstCell()
public CellReference[] getAllReferencedCells()
public java.lang.String formatAsString()
Example return values:
Result | Comment |
---|---|
A1:A1 | Single cell area reference without sheet |
A1:$C$1 | Multi-cell area reference without sheet |
Sheet1!A$1:B4 | Standard sheet name |
'O''Brien''s Sales'!B5:C6' | Sheet name with special characters |
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.