jxl.biff
Class SheetRangeImpl

java.lang.Object
  |
  +--jxl.biff.SheetRangeImpl
All Implemented Interfaces:
Range

public class SheetRangeImpl
extends java.lang.Object
implements Range

Implementation class for the Range interface. This merely holds the raw range information. This implementation is used for ranges which are present on the current working sheet, so the getSheetIndex merely returns -1


Field Summary
private  int column1
          The column number of the cell at the top left of the range
private  int column2
          The column index of the cell at the bottom right
private  int row1
          The row number of the cell at the top left of the range
private  int row2
          The row index of the cell at the bottom right
private  Sheet sheet
          A handle to the sheet containing this range
 
Constructor Summary
SheetRangeImpl(Sheet s, int c1, int r1, int c2, int r2)
          Constructor
SheetRangeImpl(SheetRangeImpl c, Sheet s)
          A copy constructor used for copying ranges between sheets
 
Method Summary
 boolean equals(java.lang.Object o)
          Standard equals method
 Cell getBottomRight()
          Gets the cell at the bottom right of this range
 int getFirstSheetIndex()
          Not supported.
 int getLastSheetIndex()
          Not supported.
 Cell getTopLeft()
          Gets the cell at the top left of this range
 void insertColumn(int c)
          A column has been inserted, so adjust the range objects accordingly
 void insertRow(int r)
          A row has been inserted, so adjust the range objects accordingly
 boolean intersects(SheetRangeImpl range)
          Sees whether there are any intersections between this range and the range passed in.
 void removeColumn(int c)
          A column has been removed, so adjust the range objects accordingly
 void removeRow(int r)
          A row has been removed, so adjust the range objects accordingly
 java.lang.String toString()
          To string method - primarily used during debugging
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

sheet

private Sheet sheet
A handle to the sheet containing this range

column1

private int column1
The column number of the cell at the top left of the range

row1

private int row1
The row number of the cell at the top left of the range

column2

private int column2
The column index of the cell at the bottom right

row2

private int row2
The row index of the cell at the bottom right
Constructor Detail

SheetRangeImpl

public SheetRangeImpl(Sheet s,
                      int c1,
                      int r1,
                      int c2,
                      int r2)
Constructor

SheetRangeImpl

public SheetRangeImpl(SheetRangeImpl c,
                      Sheet s)
A copy constructor used for copying ranges between sheets
Parameters:
r - the range to copy from
s - the writable sheet
Method Detail

getTopLeft

public Cell getTopLeft()
Gets the cell at the top left of this range
Specified by:
getTopLeft in interface Range
Returns:
the cell at the top left

getBottomRight

public Cell getBottomRight()
Gets the cell at the bottom right of this range
Specified by:
getBottomRight in interface Range
Returns:
the cell at the bottom right

getFirstSheetIndex

public int getFirstSheetIndex()
Not supported. Returns -1, indicating that it refers to the current sheet
Specified by:
getFirstSheetIndex in interface Range
Returns:
-1

getLastSheetIndex

public int getLastSheetIndex()
Not supported. Returns -1, indicating that it refers to the current sheet
Specified by:
getLastSheetIndex in interface Range
Returns:
-1

intersects

public boolean intersects(SheetRangeImpl range)
Sees whether there are any intersections between this range and the range passed in. This method is used internally by the WritableSheet to verify the integrity of merged cells, hyperlinks etc. Ranges are only ever compared for the same sheet
Parameters:
the - range to compare against
Returns:
TRUE if the ranges intersect, FALSE otherwise

toString

public java.lang.String toString()
To string method - primarily used during debugging
Overrides:
toString in class java.lang.Object
Returns:
the string version of this object

insertRow

public void insertRow(int r)
A row has been inserted, so adjust the range objects accordingly
Parameters:
r - the row which has been inserted

insertColumn

public void insertColumn(int c)
A column has been inserted, so adjust the range objects accordingly
Parameters:
c - the column which has been inserted

removeRow

public void removeRow(int r)
A row has been removed, so adjust the range objects accordingly
Parameters:
r - the row which has been inserted

removeColumn

public void removeColumn(int c)
A column has been removed, so adjust the range objects accordingly
Parameters:
c - the column which has been removed

equals

public boolean equals(java.lang.Object o)
Standard equals method
Overrides:
equals in class java.lang.Object
Returns:
TRUE if the two objects are the same, FALSE otherwise