org.miv.pherd.ntree.util
Class CellLevelData

java.lang.Object
  extended by org.miv.pherd.ntree.util.CellLevelData
All Implemented Interfaces:
CellData

public class CellLevelData
extends Object
implements CellData

Cell data item that put maintain the leveling information.

A cell data register is peer cell in an object nammed NTreeLevels so that groups of cells of the same depth are in a set nammed a level. Each time something changes in the graph, the levels are maintained automatically.

Since:
2007
Author:
Antoine Dutot

Field Summary
protected  int depth
           
protected  NTreeLevels levels
           
protected  Cell myCell
           
 
Constructor Summary
CellLevelData(NTreeLevels levels)
          New cell-level data that will register in the given levels.
 
Method Summary
protected  int getDepth()
          The depth of this data.
 CellData newCellData()
          Factory method to create new cell data when a cell is subdivided.
 void recompute()
          Recompute the data, since the cell contents changed.
 void setCell(Cell cell)
          Set the parent cell of this data.
protected  void setDepth(int depth)
          Change the depth of this data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

depth

protected int depth

levels

protected NTreeLevels levels

myCell

protected Cell myCell
Constructor Detail

CellLevelData

public CellLevelData(NTreeLevels levels)
New cell-level data that will register in the given levels.

Parameters:
levels - The levels.
Method Detail

getDepth

protected int getDepth()
The depth of this data.

Returns:
The depth.

setDepth

protected void setDepth(int depth)
Change the depth of this data.

Parameters:
depth - The new depth.

newCellData

public CellData newCellData()
Description copied from interface: CellData
Factory method to create new cell data when a cell is subdivided.

Specified by:
newCellData in interface CellData
Returns:
A new cell data element.

recompute

public void recompute()
Description copied from interface: CellData
Recompute the data, since the cell contents changed.

Specified by:
recompute in interface CellData

setCell

public void setCell(Cell cell)
Description copied from interface: CellData
Set the parent cell of this data. This occurs only once, as soon as the cell knows its data.

Specified by:
setCell in interface CellData
Parameters:
cell - The tied cell.


Copyright © 2011. All Rights Reserved.