com.rubecula.spreadsheet
Class Area

java.lang.Object
  |
  +--com.rubecula.spreadsheet.Area

public class Area
extends java.lang.Object

Class to model areas of a spreadsheet. An Area can be a rectangular set of cells; or a set of rows; or a set of columns. An Area can be unbounded in any direction.

Since:
S_0_2
Version:
$Revision: 1.2 $
Author:
Robin Hillyard

Constructor Summary
Area(CellRange rows, CellRange columns)
           
Area(java.lang.String string)
           
 
Method Summary
 long area()
          Get the area of this Area.
 CellRange getColumns()
           
 CellRange getRows()
           
 Area intersection(Area that)
          Yield the intersection of this area and that area.
 boolean isValid()
          Method to determine if this area is valid, i.e.
 Area union(Area that)
          Yield the union of this area and that area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Area

public Area(CellRange rows,
            CellRange columns)

Area

public Area(java.lang.String string)
Method Detail

isValid

public boolean isValid()
Method to determine if this area is valid, i.e. non-empty.

Returns:
true if this both rows and columns are not empty.

intersection

public Area intersection(Area that)
Yield the intersection of this area and that area.

Parameters:
that - an area which is to be intersected with this.
Returns:
an area whose columns are the intersection of this' columns and that's columns; and whose rows are the intersection of this' rows and that's rows.

union

public Area union(Area that)
Yield the union of this area and that area.

Parameters:
that - an area which is to be unioned with this.
Returns:
an area whose columns are the union of this' columns and that's columns; and whose rows are the union of this' rows and that's rows.

area

public long area()
Get the area of this Area.

Returns:
_Rows.length * _Columns.length.

getRows

public CellRange getRows()
Returns:
_Rows.

getColumns

public CellRange getColumns()
Returns:
_Columns.