This class is a container for POI usermodel row=0 column=0 cell references. It is barely a container for these two coordinates. The implementation of the Comparable interface sorts by "natural" order top left to bottom right.
Use CellAddress when you want to refer to the location of a cell in a sheet
when the concept of relative/absolute does not apply (such as the anchor location
of a cell comment). Use CellReference when the concept of
relative/absolute does apply (such as a cell reference in a formula).
CellAddresses do not have a concept of "sheet", while CellReferences do.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int | |
| public static final CellAddress | A1
A constant for references to the first cell in a sheet. |
| Access | Constructor and Description |
|---|---|
| public | CellAddress(int
Row index (first row is 0) row, int Column index (first column is 0) column)Create a new CellAddress object. |
| public | CellAddress(String
a cell address in A1 format. Address may not contain sheet name or dollar signs.
(that is, address is not a cell reference. Use address)CellAddress(CellReference) instead if
starting with a cell reference.)Create a new CellAddress object. |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns:
the object to be compared. other)Implements java. Compare this CellAddress using the "natural" row-major, column-minor ordering. |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | |
| public String | |
| public int | |
| public int | |
| public int | |
| public String |
| _col | back to summary |
|---|---|
| private final int _col | |
| _row | back to summary |
|---|---|
| private final int _row | |
| A1 | back to summary |
|---|---|
| public static final CellAddress A1 A constant for references to the first cell in a sheet. | |
| CellAddress | back to summary |
|---|---|
| public CellAddress(int row, int column) Create a new CellAddress object.
| |
| CellAddress | back to summary |
|---|---|
| public CellAddress(String address) Create a new CellAddress object.
| |
| CellAddress | back to summary |
|---|---|
| public CellAddress(CellReference reference) Create a new CellAddress object.
| |
| CellAddress | back to summary |
|---|---|
| public CellAddress(CellAddress address) Create a new CellAddress object
| |
| CellAddress | back to summary |
|---|---|
| public CellAddress(Cell cell) Create a new CellAddress object.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(CellAddress other) Implements java. Compare this CellAddress using the "natural" row-major, column-minor ordering. That is, top-left to bottom-right ordering.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| formatAsR1C1String | back to summary |
|---|---|
public String formatAsR1C1String()
| |
| formatAsString | back to summary |
|---|---|
| public String formatAsString() Same as
| |
| getColumn | back to summary |
|---|---|
| public int getColumn() Get the cell address column
| |
| getRow | back to summary |
|---|---|
| public int getRow() Get the cell address row
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |