|
xelem.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.fountain.xelem.Area
public class Area
A reference to a rectangular range.
Field Summary | |
---|---|
protected int |
c1
The left-most column of this Area. |
protected int |
c2
The right-most column of this Area. |
protected int |
r1
The top-row of this Area. |
protected int |
r2
The bottom-row of this Area. |
Constructor Summary | |
---|---|
Area(Address address1,
Address address2)
Constructs a new Area. |
|
Area(int row1,
int column1,
int row2,
int column2)
Constructs a new Area. |
|
Area(String a1_ref)
Constructs a new Area. |
Method Summary | |
---|---|
String |
getA1Reference()
Gets a string in A1-reference style denoting the range of this area. |
String |
getAbsoluteRange()
Gets a string in R1C1-reference style denoting the range of this area. |
int |
getFirstColumn()
Gets the index of the left-most column of this area. |
int |
getFirstRow()
Gets the index of the top row of this area. |
int |
getLastColumn()
Gets the index of the right-most column of this area. |
int |
getLastRow()
Gets the index of the bottom row of this area. |
boolean |
isColumnPartOfArea(int columnIndex)
Specifies whether the given column is within this area. |
boolean |
isRowPartOfArea(int rowIndex)
Specifies whether the given row is within this area. |
boolean |
isWithinArea(Address address)
Specifies whether the given address is within this area. |
boolean |
isWithinArea(int rowIndex,
int columnIndex)
Specifies whether the intersection of the given row and column index is within this area. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int r1
protected int r2
protected int c1
protected int c2
Constructor Detail |
---|
public Area(int row1, int column1, int row2, int column2)
row1
- the index of the top rowcolumn1
- the index of the left-most columnrow2
- the index of the bottom rowcolumn2
- the index of the right-most columnpublic Area(Address address1, Address address2)
address1
- the address in one corner of the areaaddress2
- the address in the opposite cornerpublic Area(String a1_ref)
Splits the string in the parameter on ":" and calculates row and column numbers with the 2 resulting strings.
a1_ref
- a string of A1-reference style
IllegalArgumentException
- if a1_ref cannot be split in two strings
using ":" as breakpoint.Address.calculateColumn(String)
,
Address.calculateRow(String)
Method Detail |
---|
public int getFirstRow()
public int getLastRow()
public int getFirstColumn()
public int getLastColumn()
public String getA1Reference()
public String getAbsoluteRange()
public boolean isWithinArea(int rowIndex, int columnIndex)
rowIndex
- the rownumbercolumnIndex
- the columnnumber
true
if the intersection is within this area,
fals
otherwise.public boolean isWithinArea(Address address)
address
- the address to be investigated
true
if the address is within this area,
false
otherwise.public boolean isRowPartOfArea(int rowIndex)
rowIndex
- the rownumber
true
if the row index is part of this area,
false
otherwise.public boolean isColumnPartOfArea(int columnIndex)
columnIndex
- the columnnumber
true
if the column index is part of this area,
false
otherwise.
|
xelem.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |