JComponentPack 1.5.0

com.zfqjava.swing.cell
Class Cell

java.lang.Object
  extended by com.zfqjava.swing.cell.Cell
All Implemented Interfaces:
Serializable

public final class Cell
extends Object
implements 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 rowIndex, int columnIndex, boolean rowAbsolute, boolean columnAbsolute)
          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.
Cell(int firstRow, int lastRow, int firstColumn, int lastColumn, boolean firstRowAbsolute, boolean lastRowAbsolute, boolean firstColumnAbsolute, boolean lastColumnAbsolute)
          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(Object obj)
           
static String getColumnName(int column)
          Returns the column name for the specified column.
 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()
           
 Cell intersection(Cell c)
          Returns the intersection of this cell and the specified cell (return null if the two cell have not intersection).
 Cell intersection(int firstRow, int lastRow, int firstColumn, int lastColumn)
          Returns the intersection of this cell and the specified cell (return null if the two cell have not intersection).
 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 isFirstColumnAbsolute()
          Determines whether the cell first column is absolute.
 boolean isFirstRowAbsolute()
          Determines whether the cell first row is absolute.
 boolean isFullColumn(int firstRow, int lastRow)
          Returns true if the specified column is a full column.
 boolean isFullColumn(int column, int firstRow, int lastRow)
          Returns true if the specified column is a full column.
 boolean isFullRow(int firstColumn, int lastColumn)
          Returns true if the specified row is a full row.
 boolean isFullRow(int row, int firstColumn, int lastColumn)
          Returns true if the specified row is a full row.
 boolean isLastColumnAbsolute()
          Determines whether the cell last column is absolute.
 boolean isLastRowAbsolute()
          Determines whether the cell last row is absolute.
 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.
 String toString()
           
static String toString(int rowIndex, int columnIndex)
          Returns the cell name.
static String toString(int rowIndex, int columnIndex, boolean rowAbsolute, boolean columnAbsolute)
          Returns the cell name.
static String toString(int firstRow, int lastRow, int firstColumn, int lastColumn)
          Returns the cell name.
static String toString(int firstRow, int lastRow, int firstColumn, int lastColumn, boolean firstRowAbsolute, boolean lastRowAbsolute, boolean firstColumnAbsolute, boolean lastColumnAbsolute)
          Returns the cell name.
 Cell union(Cell c)
          Returns the union of this cell and the specified cell.
static Cell valueOf(String s)
          Returns a cell object.
 
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 rowIndex,
            int columnIndex,
            boolean rowAbsolute,
            boolean columnAbsolute)
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
rowAbsolute - the row absolute flag
columnAbsolute - the column absolute flag

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

Cell

public Cell(int firstRow,
            int lastRow,
            int firstColumn,
            int lastColumn,
            boolean firstRowAbsolute,
            boolean lastRowAbsolute,
            boolean firstColumnAbsolute,
            boolean lastColumnAbsolute)
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
firstRowAbsolute - the first row absolute flag
lastRowAbsolute - the last row absolute flag
firstColumnAbsolute - the first column absolute flag
lastColumnAbsolute - the last column absolute flag
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

isFullRow

public boolean isFullRow(int firstColumn,
                         int lastColumn)
Returns true if the specified row is a full row.

Parameters:
firstColumn - the first column index of the specified cell area
lastColumn - the last column index of the specified cell area
Returns:
true if this is a full row, otherwise return false
Since:
JDataGrid 1.3

isFullRow

public boolean isFullRow(int row,
                         int firstColumn,
                         int lastColumn)
Returns true if the specified row is a full row.

Parameters:
row - the row index
firstColumn - the first column index of the specified cell area
lastColumn - the last column index of the specified cell area
Returns:
true if this is a full row, otherwise return false
Since:
JDataGrid 1.2

isFullColumn

public boolean isFullColumn(int firstRow,
                            int lastRow)
Returns true if the specified column is a full column.

Parameters:
firstRow - the first row index of the specified cell area
lastRow - the last row index of the specified cell area
Returns:
true if this is a full column, otherwise return false
Since:
JDataGrid 1.3

isFullColumn

public boolean isFullColumn(int column,
                            int firstRow,
                            int lastRow)
Returns true if the specified column is a full column.

Parameters:
column - the column index
firstRow - the first row index of the specified cell area
lastRow - the last row index of the specified cell area
Returns:
true if this is a full column, otherwise return false
Since:
JDataGrid 1.2

union

public Cell union(Cell c)
Returns the union of this cell and the specified cell.

Parameters:
c - the cell
Returns:
the union of this cell and the specified cell
Since:
JDataGrid 1.4

intersection

public Cell intersection(Cell c)
Returns the intersection of this cell and the specified cell (return null if the two cell have not intersection).

Returns:
the intersection of this cell and the specified cell
Since:
JDataGrid 1.4

intersection

public Cell intersection(int firstRow,
                         int lastRow,
                         int firstColumn,
                         int lastColumn)
Returns the intersection of this cell and the specified cell (return null if the two cell have not intersection).

Returns:
the intersection of this cell and the specified cell
Since:
JDataGrid 1.4

isFirstRowAbsolute

public boolean isFirstRowAbsolute()
Determines whether the cell first row is absolute.

Returns:
true if the cell first row is absolute, false if the cell first row is absolute
Since:
JDataGrid 1.4

isFirstColumnAbsolute

public boolean isFirstColumnAbsolute()
Determines whether the cell first column is absolute.

Returns:
true if the cell first column is absolute, false if the cell first column is absolute
Since:
JDataGrid 1.4

isLastRowAbsolute

public boolean isLastRowAbsolute()
Determines whether the cell last row is absolute.

Returns:
true if the cell last row is absolute, false if the cell last row is absolute
Since:
JDataGrid 1.4

isLastColumnAbsolute

public boolean isLastColumnAbsolute()
Determines whether the cell last column is absolute.

Returns:
true if the cell last column is absolute, false if the cell last column is absolute
Since:
JDataGrid 1.4

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

toString

public String toString()
Overrides:
toString in class Object

valueOf

public static Cell valueOf(String s)
                    throws ParseException
Returns a cell object.

Parameters:
s - the string
Returns:
the cell object
Throws:
ParseException

toString

public static String toString(int rowIndex,
                              int columnIndex)
Returns the cell name.

Parameters:
rowIndex - the row index of specified cell
columnIndex - the column index of specified cell
Returns:
the cell name
Since:
JDataGrid 1.7.0

toString

public static String toString(int rowIndex,
                              int columnIndex,
                              boolean rowAbsolute,
                              boolean columnAbsolute)
Returns the cell name.

Parameters:
rowIndex - the row index of specified cell
columnIndex - the column index of specified cell
rowAbsolute - the row absolute flag
columnAbsolute - the column absolute flag
Returns:
the cell name
Since:
JDataGrid 1.4

toString

public static String toString(int firstRow,
                              int lastRow,
                              int firstColumn,
                              int lastColumn)
Returns the cell name.

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
Returns:
the cell name
Since:
JDataGrid 2.0

toString

public static String toString(int firstRow,
                              int lastRow,
                              int firstColumn,
                              int lastColumn,
                              boolean firstRowAbsolute,
                              boolean lastRowAbsolute,
                              boolean firstColumnAbsolute,
                              boolean lastColumnAbsolute)
Returns the cell name.

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
firstRowAbsolute - the first row absolute flag
lastRowAbsolute - the last row absolute flag
firstColumnAbsolute - the first column absolute flag
lastColumnAbsolute - the last column absolute flag
Returns:
the cell name
Since:
JDataGrid 1.4

getColumnName

public static String getColumnName(int column)
Returns the column name for the specified column.

Parameters:
column - the column index
Returns:
the column name
Since:
JDataGrid 1.6.1

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.