net.sf.jeppers.grid
Class CellSpan

java.lang.Object
  |
  +--net.sf.jeppers.grid.CellSpan

public class CellSpan
extends Object

This class embodies the idea that cells can be merged. That is a cell can span over cells to the right and to the bottom. The cell which is displayed by the span is referred to as the anchor cell.

Author:
Cameron Zemek

Constructor Summary
CellSpan(int anchorRow, int anchorColumn, int rowCount, int columnCount)
          Create a CellSpan that represents a span at anchorRow and anchorColumn that spans over the following rowCount rows and columnCount columns.
 
Method Summary
 boolean containsCell(int row, int column)
          Returns true if the cell at row and column is part of the span.
 int getColumn()
          Return the anchor column.
 int getColumnCount()
          Return the number of columns that the span covers.
 int getFirstColumn()
          Return the first column that the span covers.
 int getFirstRow()
          Return the first row that the span covers.
 int getLastColumn()
          Return the last column that the span covers.
 int getLastRow()
          Return the last row that the span covers.
 int getRow()
          Return the anchor row.
 int getRowCount()
          Return the number of rows that the span covers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellSpan

public CellSpan(int anchorRow,
                int anchorColumn,
                int rowCount,
                int columnCount)
Create a CellSpan that represents a span at anchorRow and anchorColumn that spans over the following rowCount rows and columnCount columns.

Method Detail

getRow

public int getRow()
Return the anchor row.

Returns:
row index of anchor cell.

getColumn

public int getColumn()
Return the anchor column.

Returns:
column index of anchor cell.

getRowCount

public int getRowCount()
Return the number of rows that the span covers.

Returns:
number of rows included in the span.

getColumnCount

public int getColumnCount()
Return the number of columns that the span covers.

Returns:
number of columns included in the span.

getFirstRow

public int getFirstRow()
Return the first row that the span covers.

Returns:
the anchor row

getLastRow

public int getLastRow()
Return the last row that the span covers.

Returns:
the last row of the span.

getFirstColumn

public int getFirstColumn()
Return the first column that the span covers.

Returns:
the anchor column

getLastColumn

public int getLastColumn()
Return the last column that the span covers.

Returns:
the last column of the span.

containsCell

public boolean containsCell(int row,
                            int column)
Returns true if the cell at row and column is part of the span. That is, the specified cell is the anchor cell or is hidden by the span.