complex
Class DBComplex

java.lang.Object
  extended bycomplex.AbstractComplex
      extended bycomplex.DBComplex
All Implemented Interfaces:
Complex
Direct Known Subclasses:
DBGeoComplex

public class DBComplex
extends AbstractComplex

A complex, which is contained in a database.

Author:
ting

Field Summary
 DBSession session
           
 
Constructor Summary
DBComplex(DBSession session)
           
 
Method Summary
protected  java.util.Set getAllBoundaryCells(java.util.Set collection, java.sql.Connection con)
           
protected  java.sql.ResultSet getAllCells()
           
 Cell getCell(CellID cell)
          Returns the cell with the specified ID.
 int getCellCount()
          Returns the number of cells in this complex object.
 java.util.Iterator getCellIterator()
          Returns an iterator over the Cells contained in this Complex.
 EditableComplex getCopy()
          copy database to standardComplex
 int getDim()
          Returns the Dimension of the complex (which has to be larger or equal to the maximal dimension of the contained cells).
 CellID getMaxCellID()
          Returns The maximum CellID of this complex object.
 EditableComplex getPartofComplex(java.util.Set collection)
          collection consist of CellID
 boolean hasCell(CellID cell)
          Checks if a cell with the specified ID is contained in this complex.
 
Methods inherited from class complex.AbstractComplex
boundary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

public DBSession session
Constructor Detail

DBComplex

public DBComplex(DBSession session)
Method Detail

getDim

public int getDim()
Description copied from interface: Complex
Returns the Dimension of the complex (which has to be larger or equal to the maximal dimension of the contained cells). if this complex contains no cell, returns -1

Returns:
the Dimension of the complex

getCellIterator

public java.util.Iterator getCellIterator()
Description copied from interface: Complex
Returns an iterator over the Cells contained in this Complex.

Returns:
an iterator of instances of Cell

getAllCells

protected java.sql.ResultSet getAllCells()

getCell

public Cell getCell(CellID cell)
Description copied from interface: Complex
Returns the cell with the specified ID.

Parameters:
cell - the ID of the cell
Returns:
the selected cell as an instance of Cell

hasCell

public boolean hasCell(CellID cell)
Description copied from interface: Complex
Checks if a cell with the specified ID is contained in this complex.

Parameters:
cell - the ID of the cell
Returns:
true if this complex contains a cell with this ID

getCellCount

public int getCellCount()
Description copied from interface: Complex
Returns the number of cells in this complex object.

Specified by:
getCellCount in interface Complex
Overrides:
getCellCount in class AbstractComplex

getMaxCellID

public CellID getMaxCellID()
Description copied from interface: Complex
Returns The maximum CellID of this complex object.

Specified by:
getMaxCellID in interface Complex
Overrides:
getMaxCellID in class AbstractComplex

getCopy

public EditableComplex getCopy()
copy database to standardComplex

Returns:
a StandardComplex of this complex

getPartofComplex

public EditableComplex getPartofComplex(java.util.Set collection)
collection consist of CellID

Parameters:
collection -
Returns:

getAllBoundaryCells

protected java.util.Set getAllBoundaryCells(java.util.Set collection,
                                            java.sql.Connection con)