org.geotools.caching.grid.spatialindex
Class GridRootNode

java.lang.Object
  extended by org.geotools.caching.grid.spatialindex.GridNode
      extended by org.geotools.caching.grid.spatialindex.GridRootNode
All Implemented Interfaces:
java.io.Serializable, Entry, Node

public class GridRootNode
extends GridNode

The root node of a grid, which has n GridNodes as children. As GridNodes do, it can store data too.

Author:
Christophe Rousson, SoC 2007, CRG-ULAVAL
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList<NodeIdentifier> children
           
protected  int childrenCapacity
           
protected  int[] tiles_number
           
protected  double tiles_size
           
 
Fields inherited from class org.geotools.caching.grid.spatialindex.GridNode
data, id
 
Constructor Summary
protected GridRootNode(int gridsize, RegionNodeIdentifier id)
          the mbr is read from the id;
 
Method Summary
 void clear()
          Only clears data the root node; does not clear the children.
protected  GridNode createNode(RegionNodeIdentifier id)
           
 int getCapacity()
          The maximum of allowable nodes in the grid.
 NodeIdentifier getChildIdentifier(int index)
           
 java.util.List<java.lang.Integer> getChildren(Shape shape)
           
 int getChildrenCount()
           
 int getLevel()
           
 int getMaximumTileCount(int dim)
          The number of tiles/nodes in a given dimension.
 double getTileSize()
           
 int gridIndexToNodeId(int[] index)
          Converts an array of indexes into the id of a node.
 boolean isIndex()
           
 boolean isLeaf()
          If the node is a leaf node (has no children)
 void setChildIdentifier(int index, NodeIdentifier id)
           
protected  void split(GridSpatialIndex index)
          Creates the grid by appending children to this node.
 java.lang.String toReadableText()
           
 java.lang.String toString()
           
 
Methods inherited from class org.geotools.caching.grid.spatialindex.GridNode
deleteData, getData, getDataCount, getIdentifier, getShape, insertData, setIdentifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tiles_size

protected double tiles_size

tiles_number

protected int[] tiles_number

children

protected java.util.ArrayList<NodeIdentifier> children

childrenCapacity

protected int childrenCapacity
Constructor Detail

GridRootNode

protected GridRootNode(int gridsize,
                       RegionNodeIdentifier id)
the mbr is read from the id;

Method Detail

split

protected void split(GridSpatialIndex index)
Creates the grid by appending children to this node.


getChildren

public java.util.List<java.lang.Integer> getChildren(Shape shape)

createNode

protected GridNode createNode(RegionNodeIdentifier id)

toString

public java.lang.String toString()
Overrides:
toString in class GridNode

getChildIdentifier

public NodeIdentifier getChildIdentifier(int index)
                                  throws java.lang.IndexOutOfBoundsException
Specified by:
getChildIdentifier in interface Node
Overrides:
getChildIdentifier in class GridNode
Returns:
the child node identifier at the given index
Throws:
java.lang.IndexOutOfBoundsException

setChildIdentifier

public void setChildIdentifier(int index,
                               NodeIdentifier id)

getChildrenCount

public int getChildrenCount()
Specified by:
getChildrenCount in interface Node
Overrides:
getChildrenCount in class GridNode
Returns:
the number of child nodes

getLevel

public int getLevel()
Specified by:
getLevel in interface Node
Overrides:
getLevel in class GridNode

isIndex

public boolean isIndex()
Specified by:
isIndex in interface Node
Overrides:
isIndex in class GridNode

isLeaf

public boolean isLeaf()
Description copied from interface: Node
If the node is a leaf node (has no children)

Specified by:
isLeaf in interface Node
Overrides:
isLeaf in class GridNode
Returns:

gridIndexToNodeId

public int gridIndexToNodeId(int[] index)
Converts an array of indexes into the id of a node.

Parameters:
index -
Returns:

clear

public void clear()
Only clears data the root node; does not clear the children.

Specified by:
clear in interface Node
Overrides:
clear in class GridNode

toReadableText

public java.lang.String toReadableText()
Overrides:
toReadableText in class GridNode

getCapacity

public int getCapacity()
The maximum of allowable nodes in the grid.

Returns:

getMaximumTileCount

public int getMaximumTileCount(int dim)
The number of tiles/nodes in a given dimension.

Parameters:
dim -
Returns:

getTileSize

public double getTileSize()


Copyright © 1996-2010 Geotools. All Rights Reserved.