complex
Class StandardComplex

java.lang.Object
  extended bycomplex.AbstractComplex
      extended bycomplex.StandardComplex
All Implemented Interfaces:
Complex, EditableComplex
Direct Known Subclasses:
StandardGeoComplex

public class StandardComplex
extends AbstractComplex
implements EditableComplex

A standard implementation of a complex, using a HashMap of cells.

Author:
ting

Field Summary
protected  java.util.SortedMap cellMap
           
protected  int dimension
           
 
Constructor Summary
StandardComplex(int dim)
           
StandardComplex(java.util.SortedMap map, int dim)
           
 
Method Summary
 void addCell(StandardCell cell)
           
private  java.util.Set getAllBoundaryCells(java.util.Set collection)
           
 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 simple this complex a new complex with same data, but the return type should be EditableComplex, z.b copy DBComplex nach 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, search a minimal editable complex, which contains all member of this collection
 boolean hasCell(CellID cell)
          Checks if a cell with the specified ID is contained in this complex.
 void removeCell(CellID cellID)
           
 
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
 
Methods inherited from interface complex.Complex
boundary
 

Field Detail

cellMap

protected java.util.SortedMap cellMap

dimension

protected int dimension
Constructor Detail

StandardComplex

public StandardComplex(java.util.SortedMap map,
                       int dim)

StandardComplex

public StandardComplex(int dim)
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

Specified by:
getDim in interface Complex
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.

Specified by:
getCellIterator in interface Complex
Returns:
an iterator of instances 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.

Specified by:
hasCell in interface Complex
Parameters:
cell - the ID of the cell
Returns:
true if this complex contains a cell with this ID

getCell

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

Specified by:
getCell in interface Complex
Parameters:
cell - the ID of the cell
Returns:
the selected cell as an instance of Cell

addCell

public void addCell(StandardCell cell)
Specified by:
addCell in interface EditableComplex

removeCell

public void removeCell(CellID cellID)
Specified by:
removeCell in interface EditableComplex

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()
Description copied from interface: Complex
copy simple this complex a new complex with same data, but the return type should be EditableComplex, z.b copy DBComplex nach StandardComplex

Specified by:
getCopy in interface Complex
Returns:
this complex

getPartofComplex

public EditableComplex getPartofComplex(java.util.Set collection)
Description copied from interface: Complex
collection consist of CellID, search a minimal editable complex, which contains all member of this collection

Specified by:
getPartofComplex in interface Complex
Parameters:
collection -
Returns:

getAllBoundaryCells

private java.util.Set getAllBoundaryCells(java.util.Set collection)