jxl.biff
Class SheetRangeImpl

java.lang.Object
  extended byjxl.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


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
 int hashCode()
          Standard hash code method
 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, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SheetRangeImpl

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

Parameters:
s - the sheet containing the range
c1 - the column number of the top left cell of the range
r1 - the row number of the top left cell of the range
c2 - the column number of the bottom right cell of the range
r2 - the row number of the bottomr right cell of the range

SheetRangeImpl

public SheetRangeImpl(SheetRangeImpl c,
                      Sheet s)
A copy constructor used for copying ranges between sheets

Parameters:
c - 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:
range - 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

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

hashCode

public int hashCode()
Standard hash code method

Returns:
the hash code

equals

public boolean equals(java.lang.Object o)
Standard equals method

Parameters:
o - the object to compare
Returns:
TRUE if the two objects are the same, FALSE otherwise