adams.data.spreadsheet.cellfinder
Class CellLocation

java.lang.Object
  extended by adams.data.spreadsheet.cellfinder.CellLocation
All Implemented Interfaces:
Serializable

public class CellLocation
extends Object
implements Serializable

Container object for a cell location (row and column).

Version:
$Revision: 6602 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  int m_Column
          the 0-based column.
protected  int m_Row
          the 0-based row.
 
Constructor Summary
CellLocation(int row, int col)
          Initializes the position.
CellLocation(String position)
          Initializes the position with a cell string, like "A1".
 
Method Summary
 int getColumn()
          Returns the stored column.
 int getRow()
          Returns the stored row.
 String toPosition()
          Returns the cell location as position string, like "A1".
 String toString()
          Returns a short description of the location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Row

protected int m_Row
the 0-based row.


m_Column

protected int m_Column
the 0-based column.

Constructor Detail

CellLocation

public CellLocation(int row,
                    int col)
Initializes the position.

Parameters:
row - the 0-based row
col - the 0-based column

CellLocation

public CellLocation(String position)
             throws Exception
Initializes the position with a cell string, like "A1".

Parameters:
position - the cell position
Throws:
Exception - if position is invalid
Method Detail

getRow

public int getRow()
Returns the stored row.

Returns:
the 0-based row

getColumn

public int getColumn()
Returns the stored column.

Returns:
the 0-based column

toPosition

public String toPosition()
Returns the cell location as position string, like "A1".

Returns:
the position

toString

public String toString()
Returns a short description of the location.

Overrides:
toString in class Object
Returns:
the location as string


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.