Back to index

wims  3.65+svn20090927
Public Member Functions | Private Attributes
SharpTools.CellPoint Class Reference

List of all members.

Public Member Functions

 CellPoint (int aRow, int aCol)
 Creates a new CellPoint.
int getRow ()
 Gets the row of cell referenced by this CellPoint.
int getCol ()
 gets the column coordinate of cell reference stored.
void setRow (int row)
 Sets the row coordinate of cell reference to be stored.
void setCol (int col)
 Sets column coordinate.
void incrRow (int x)
 Increments row coordinate.
void incrCol (int x)
 Increments column coordinate.
int compareTo (Object x)
 Compares CellPoints by row and then by column field.
boolean equals (Object x)
 Two CellPoints are equal if all the fields are equal.
String toString ()
 Converts the object to a string representation.

Private Attributes

int row
 This hold row coordinate of a cell.
int col
 This holds column coordinate of a cell.

Detailed Description

Definition at line 21 of file CellPoint.java.


Constructor & Destructor Documentation

SharpTools.CellPoint.CellPoint ( int  aRow,
int  aCol 
) [inline]

Creates a new CellPoint.

Parameters:
aRowrow of a cell
aColcolumn of a cell

Definition at line 34 of file CellPoint.java.

                                         {
        row = aRow;
        col = aCol;
    }

Here is the caller graph for this function:


Member Function Documentation

int SharpTools.CellPoint.compareTo ( Object  x) [inline]

Compares CellPoints by row and then by column field.

It is used by the reference list to maintain itself.

Parameters:
xCellPoint to be compares
Returns:
1 if greater, 0 if equal and -1 if > x

Definition at line 82 of file CellPoint.java.

                                   {
        if (x instanceof CellPoint) {
            CellPoint y = (CellPoint)x;
            
            //by row
            if (this.row > y.row) {
                return 1;
            }else {
                if (this.row == y.row) {
                    
                    //by column
                    if (this.col > y.col) {
                        return 1;
                    }else {
                        
                        //equal
                        if (this.col == y.col) {
                            return 0;
                        }else return -1;
                    }
                }else {
                    return -1;
                }
            }
        }else return 2;         /* can't compare non-CellPoint objects */
    }

Here is the call graph for this function:

boolean SharpTools.CellPoint.equals ( Object  x) [inline]

Two CellPoints are equal if all the fields are equal.

Useful for updating the reference list.

Parameters:
xCellPoint to compare this to
Returns:
true iff all fields equal

Definition at line 116 of file CellPoint.java.

                                    {
        if (x instanceof CellPoint) {
            CellPoint y = (CellPoint)x;
            return ((this.row == y.row) && (this.col == y.col));
        }else return false;
    }

Here is the call graph for this function:

int SharpTools.CellPoint.getCol ( ) [inline]

gets the column coordinate of cell reference stored.

Returns:
column value

Definition at line 49 of file CellPoint.java.

{ return col; }

Here is the caller graph for this function:

int SharpTools.CellPoint.getRow ( ) [inline]

Gets the row of cell referenced by this CellPoint.

Returns:
row value

Definition at line 44 of file CellPoint.java.

{ return row; }

Here is the caller graph for this function:

void SharpTools.CellPoint.incrCol ( int  x) [inline]

Increments column coordinate.

Parameters:
xamount to increment column coordinate

Definition at line 73 of file CellPoint.java.

{ this.col += x; }
void SharpTools.CellPoint.incrRow ( int  x) [inline]

Increments row coordinate.

Parameters:
xamount to increment row coordinate by

Definition at line 68 of file CellPoint.java.

{ this.row += x; }
void SharpTools.CellPoint.setCol ( int  col) [inline]

Sets column coordinate.

Parameters:
colvalue to set column coordinate to

Definition at line 63 of file CellPoint.java.

{ this.col = col; }
void SharpTools.CellPoint.setRow ( int  row) [inline]

Sets the row coordinate of cell reference to be stored.

Parameters:
rowvalue to set row to

Definition at line 56 of file CellPoint.java.

{ this.row = row; }
String SharpTools.CellPoint.toString ( ) [inline]

Converts the object to a string representation.

Returns:
a string representation of CellPoint

Definition at line 128 of file CellPoint.java.

                             {
       return Node.translateColumn(col)+Node.translateRow(row);
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int SharpTools.CellPoint.col [private]

This holds column coordinate of a cell.

Definition at line 26 of file CellPoint.java.

int SharpTools.CellPoint.row [private]

This hold row coordinate of a cell.

Definition at line 23 of file CellPoint.java.


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