Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
SharpTools.CellRange Class Reference

This class specifies how a range of cells are represented. More...

Collaboration diagram for SharpTools.CellRange:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CellRange (int[] rows, int[] cols)
 Creates new CellRange.
 CellRange (int minRow, int maxRow, int minCol, int maxCol)
 This contructor takes x1, x2, y1, y2 and constructs a range.
 CellRange (CellPoint ULHCorner, CellPoint LRHCorner)
 This constructor takes two CellPoints to construct a range.
int getStartRow ()
 This returns the first row in the range.
int getEndRow ()
 This returns the last row in the range.
int getStartCol ()
 This returns the first column in the range.
int getEndCol ()
 This returns the last column in the range.
int getWidth ()
 This returns the number of columns in the range.
int getHeight ()
 This returns the number of rows in the range.
CellPoint getminCorner ()
 This returns the upper left corner of the range.
CellPoint getmaxCorner ()
 This returns the lower right corner of the range.
String toString ()
 This returns a string represetation of the difference of the upper left and lower right corners.

Package Attributes

CellPoint minCorner
 Upper left corner of range.
CellPoint maxCorner
 Lower right corner of range.

Detailed Description

This class specifies how a range of cells are represented.

A range is a continuous rectangular area that can be specified by its upper left corner (minCorner) and lower right corner (maxCorner).

Author:
Ricky Chin
Version:
Id:
CellRange.java,v 1.13 2000/12/02 21:44:51 rkc10 Exp

Definition at line 18 of file CellRange.java.


Constructor & Destructor Documentation

SharpTools.CellRange.CellRange ( int[]  rows,
int[]  cols 
) [inline]

Creates new CellRange.

In assumes that the array parameters have entries listed in ascending order. In other words, the row array has the row with the smallest number in index 0 and largest row in the last index. The same goes for the column array.

Parameters:
rowsthe array range of rows
colsthe array range of columns

Definition at line 33 of file CellRange.java.

                                             {
        //rows selected are in ascending order
        int minRow = rows[0];
        int maxRow = rows[rows.length - 1];
        
        //columns selected are in ascending order
        int minCol = cols[0];
        int maxCol = cols[cols.length - 1];
              
         minCorner = new CellPoint(minRow, minCol);
         maxCorner = new CellPoint(maxRow, maxCol);
       }
SharpTools.CellRange.CellRange ( int  minRow,
int  maxRow,
int  minCol,
int  maxCol 
) [inline]

This contructor takes x1, x2, y1, y2 and constructs a range.

Parameters:
minRowupper left corner row coordinate
minColupper left corner col coordinate
maxRowlower right corner row coordinate
maxCollower right corner col coordinate

Definition at line 54 of file CellRange.java.

                                                                     {
       
       minCorner = new CellPoint(minRow, minCol);
       maxCorner = new CellPoint(maxRow, maxCol);
    }
SharpTools.CellRange.CellRange ( CellPoint  ULHCorner,
CellPoint  LRHCorner 
) [inline]

This constructor takes two CellPoints to construct a range.

Parameters:
ULHCornerupper left corner
LRHCornerlower right corner

Definition at line 66 of file CellRange.java.

                                                               {
            minCorner = ULHCorner;
            maxCorner = LRHCorner;
    }

Member Function Documentation

This returns the last column in the range.

Returns:
last column of range

Definition at line 103 of file CellRange.java.

                           {
        return maxCorner.getCol();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

This returns the last row in the range.

Returns:
last row of range

Definition at line 85 of file CellRange.java.

                           {
        return maxCorner.getRow();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

This returns the number of rows in the range.

Returns:
number of rows in range

Definition at line 121 of file CellRange.java.

                           {
        return getEndRow() - getStartRow() + 1;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

This returns the lower right corner of the range.

Returns:
the lower right corner of the range

Definition at line 134 of file CellRange.java.

                                    {
        return maxCorner;
    }

Here is the caller graph for this function:

This returns the upper left corner of the range.

Returns:
the upper left corner of the range

Definition at line 128 of file CellRange.java.

                                    {
        return minCorner;
    }

Here is the caller graph for this function:

This returns the first column in the range.

Returns:
first column of range

Definition at line 94 of file CellRange.java.

                             {
        return minCorner.getCol();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

This returns the first row in the range.

Returns:
first row of range

Definition at line 76 of file CellRange.java.

                             {
        return minCorner.getRow();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

This returns the number of columns in the range.

Returns:
number of columns in range

Definition at line 112 of file CellRange.java.

                          {
        return getEndCol() - getStartCol() + 1;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

String SharpTools.CellRange.toString ( ) [inline]

This returns a string represetation of the difference of the upper left and lower right corners.

Returns:
string minCorner - maxCorner

Definition at line 144 of file CellRange.java.

                             {
       return minCorner.toString()+':'+maxCorner.toString();
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Lower right corner of range.

Definition at line 24 of file CellRange.java.

Upper left corner of range.

Definition at line 21 of file CellRange.java.


The documentation for this class was generated from the following file: