Class CellLocation

  • All Implemented Interfaces:
    Serializable

    public class CellLocation
    extends Object
    implements Serializable
    Container object for a cell location (row and column).
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • 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