com.zfqjava.swing.cell
Class Cell

java.lang.Object
  |
  +--com.zfqjava.swing.cell.Cell
All Implemented Interfaces:
java.io.Serializable

public final class Cell
extends java.lang.Object
implements java.io.Serializable

Cell provides a cell object. All row or column index must be >= 0, and all first index must be <= last index.

Note:All methods with Cell parameter pass null value will throws java.lang.NullPointerException.

See Also:
Serialized Form

Constructor Summary
Cell(int rowIndex, int columnIndex)
          Constructs a cell object at the specified rowIndex and columnIndex.
Cell(int firstRow, int lastRow, int firstColumn, int lastColumn)
          Constructs a cell object for the specified area.
 
Method Summary
 boolean contains(Cell c)
          Determines whether this cell contains the c.
 boolean contains(int rowIndex, int columnIndex)
          Determines whether this cell contains the cell at the specified rowIndex and columnIndex.
 boolean contains(int firstRow, int lastRow, int firstColumn, int lastColumn)
          Determines whether this cell contains the cell at the specified area.
 boolean containsColumn(int columnIndex)
          Determines whether this cell contains the column.
 boolean containsRow(int rowIndex)
          Determines whether this cell contains the row.
 boolean equals(java.lang.Object obj)
           
 int getFirstColumn()
          Returns the first column of this cell.
 int getFirstRow()
          Returns the first row of this cell.
 int getHeight()
          Returns the cell height.
 int getLastColumn()
          Returns the last column of this cell.
 int getLastRow()
          Returns the last row of this cell.
 int getWidth()
          Returns the cell width.
 int getX()
          Returns the cell x location.
 int getY()
          Returns the cell y location.
 int hashCode()
           
 boolean intersects(Cell c)
          Determines whether this cell intersects the cell at the specified area.
 boolean intersects(int firstRow, int lastRow, int firstColumn, int lastColumn)
          Determines whether this cell intersects the cell at the specified area.
 boolean isSingleCell()
          Returns true if this is a single cell.
 boolean isSingleColumn()
          Returns true if this is a single column.
 boolean isSingleRow()
          Returns true if this is a single row.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cell

public Cell(int rowIndex,
            int columnIndex)
Constructs a cell object at the specified rowIndex and columnIndex.
Parameters:
rowIndex - the row index of specified cell
columnIndex - the column index of specified cell

Cell

public Cell(int firstRow,
            int lastRow,
            int firstColumn,
            int lastColumn)
Constructs a cell object for the specified area.
Parameters:
firstRow - the first row index of the specified cell area
lastRow - the last row index of the specified cell area
firstColumn - the first column index of the specified cell area
lastColumn - the last column index of the specified cell area
Method Detail

getFirstRow

public int getFirstRow()
Returns the first row of this cell.
Returns:
the first row index of the specified cell area

getFirstColumn

public int getFirstColumn()
Returns the first column of this cell.
Returns:
the first column index of the specified cell area

getLastRow

public int getLastRow()
Returns the last row of this cell.
Returns:
the last row index of the specified cell area

getLastColumn

public int getLastColumn()
Returns the last column of this cell.
Returns:
the last column index of the specified cell area

getX

public int getX()
Returns the cell x location.
Returns:
the cell x location
Since:
JDataGrid 1.1

getY

public int getY()
Returns the cell y location.
Returns:
the cell y location
Since:
JDataGrid 1.1

getWidth

public int getWidth()
Returns the cell width.
Returns:
the cell width
Since:
JDataGrid 1.1

getHeight

public int getHeight()
Returns the cell height.
Returns:
the cell height
Since:
JDataGrid 1.1

containsRow

public boolean containsRow(int rowIndex)
Determines whether this cell contains the row.
Parameters:
rowIndex - the row index
Returns:
true if this cell contains the row
Since:
JDataGrid 1.1

containsColumn

public boolean containsColumn(int columnIndex)
Determines whether this cell contains the column.
Parameters:
columnIndex - the column index
Returns:
true if this cell contains the column
Since:
JDataGrid 1.1

contains

public boolean contains(int rowIndex,
                        int columnIndex)
Determines whether this cell contains the cell at the specified rowIndex and columnIndex.
Parameters:
rowIndex - the row index
columnIndex - the column index
See Also:
contains(int, int)

contains

public boolean contains(int firstRow,
                        int lastRow,
                        int firstColumn,
                        int lastColumn)
Determines whether this cell contains the cell at the specified area.
Parameters:
firstRow - the first row index of the specified cell area
lastRow - the last row index of the specified cell area
firstColumn - the first column index of the specified cell area
lastColumn - the last column index of the specified cell area
See Also:
contains(int, int)

contains

public boolean contains(Cell c)
Determines whether this cell contains the c.
Parameters:
c - the cell
See Also:
contains(int, int)

intersects

public boolean intersects(int firstRow,
                          int lastRow,
                          int firstColumn,
                          int lastColumn)
Determines whether this cell intersects the cell at the specified area.
Parameters:
firstRow - the first row index of the specified cell area
lastRow - the last row index of the specified cell area
firstColumn - the first column index of the specified cell area
lastColumn - the last column index of the specified cell area

intersects

public boolean intersects(Cell c)
Determines whether this cell intersects the cell at the specified area.
Parameters:
c - the cell
See Also:
intersects(int, int, int, int)

isSingleCell

public boolean isSingleCell()
Returns true if this is a single cell.
Returns:
true if this is a single cell, otherwise return false

isSingleColumn

public boolean isSingleColumn()
Returns true if this is a single column.
Returns:
true if this is a single column, otherwise return false
Since:
JDataGrid 1.1

isSingleRow

public boolean isSingleRow()
Returns true if this is a single row.
Returns:
true if this is a single row, otherwise return false
Since:
JDataGrid 1.1

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2003 Extreme Component, Inc. All rights reserved.