public class AreaReference
extends java.lang.Object
Constructor and Description |
---|
AreaReference(CellReference topLeft,
CellReference botRight)
Creates an area ref from a pair of Cell References.
|
AreaReference(java.lang.String reference)
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(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(java.lang.String start,
java.lang.String end) |
static AreaReference |
getWholeRow(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(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)
public AreaReference(CellReference topLeft, CellReference botRight)
public static boolean isContiguous(java.lang.String reference)
generateContiguous(String)
)public static AreaReference getWholeRow(java.lang.String start, java.lang.String end)
public static AreaReference getWholeColumn(java.lang.String start, java.lang.String end)
public static boolean isWholeColumnReference(CellReference topLeft, CellReference botRight)
public boolean isWholeColumnReference()
public static AreaReference[] generateContiguous(java.lang.String reference)
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()
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 2014 The Apache Software Foundation or its licensors, as applicable.