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) |
static AreaReference |
getWholeRow(SpreadsheetVersion version,
java.lang.String start,
java.lang.String end) |
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)
public static AreaReference getWholeColumn(SpreadsheetVersion version, java.lang.String start, java.lang.String end)
public 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()
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 2020 The Apache Software Foundation or its licensors, as applicable.