JIDE 3.5.15

com.jidesoft.grid
Class CellSpan

java.lang.Object
  extended by com.jidesoft.grid.CellSpan
All Implemented Interfaces:
Cloneable

public class CellSpan
extends Object
implements Cloneable

CellSpan defines a cell span. Each cell span has an anchor cell which is determined by the row and column. It also has rowSpan and columnSpan. Both should be a positive integer. One of the value could be 1 but not both. If both are 1, it means no span.

See below for an example.

  
0,0 0,1 0,2 0,3
1,0 1,1
2,0
3,0 3,1 3,2 3,3
To define a cell span of cell(1,1) which is marked in red, the CellSpan will be new CellSpan(1, 1, 2, 3). We describe it as a cell span with anchor cell at (1,1), row span is 2 and column span is 3.


Constructor Summary
CellSpan(CellSpan span)
           
CellSpan(int row, int column, int rowSpan, int columnSpan)
          Creates a cell span.
 
Method Summary
 Object clone()
           
 boolean contains(int rowIndex, int columnIndex)
          Checks if the rowIndex and columnIndex is within the scope of the cell span.
 boolean equals(Object o)
           
 int getColumn()
          Gets the row index of anchor cell.
 int getColumnSpan()
          Gets the column span.
 int getRow()
          Gets the row index of anchor cell.
 int getRowSpan()
          Gets the row span.
 int hashCode()
           
 void setColumn(int column)
          Sets the column index for anchor cell.
 void setColumnSpan(int columnSpan)
          Sets the column span.
 void setRow(int row)
          Sets the row index for anchor cell.
 void setRowSpan(int rowSpan)
          Sets the row span.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellSpan

public CellSpan(int row,
                int column,
                int rowSpan,
                int columnSpan)
Creates a cell span.

Parameters:
row - the row index of anchor cell.
column - the column index of anchor cell.
rowSpan - the row span. Should be positive integer.
columnSpan - the column span. Should be positive integer.

CellSpan

public CellSpan(CellSpan span)
Method Detail

getRow

public int getRow()
Gets the row index of anchor cell.

Returns:
the row index of anchor cell.

setRow

public void setRow(int row)
Sets the row index for anchor cell.

Parameters:
row -

getColumn

public int getColumn()
Gets the row index of anchor cell.

Returns:
the row index of anchor cell.

setColumn

public void setColumn(int column)
Sets the column index for anchor cell.

Parameters:
column -

getRowSpan

public int getRowSpan()
Gets the row span. The value of row span is the number of rows that this cell span will cover.

Returns:
the row span.

setRowSpan

public void setRowSpan(int rowSpan)
Sets the row span.

Parameters:
rowSpan -

getColumnSpan

public int getColumnSpan()
Gets the column span. The value of column span is the number of columns that this cell span will cover.

Returns:
the column span.

setColumnSpan

public void setColumnSpan(int columnSpan)
Sets the column span.

Parameters:
columnSpan -

contains

public boolean contains(int rowIndex,
                        int columnIndex)
Checks if the rowIndex and columnIndex is within the scope of the cell span.

Parameters:
rowIndex -
columnIndex -
Returns:
true if the cell span contains the cell specified by rowIndex and columnIndex. Otherwise false.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

clone

public Object clone()
Overrides:
clone in class Object

JIDE 3.5.15