Class Node
- Object
-
- Node
-
- Direct Known Subclasses:
FileSystemNode
public class Node extends Object
- Author:
- Tommaso Nolli
-
-
Field Summary
Fields Modifier and Type Field Description protected intnumShapesIdprotected int[]shapesIdprotected List<Node>subNodes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShapeId(int id)Add a shape idvoidaddSubNode(Node node)voidclean()To be used only against in memory nodes, allows to start over on rebuilding this nodevoidclearSubNodes()voidclose()Clears up whatever resources the node is hanging ontoNodecopy()EnvelopegetBounds()intgetNumShapeIds()intgetNumSubNodes()intgetShapeId(int pos)Gets a shape idint[]getShapesId()NodegetSubNode(int pos)Gets the Node at the requested positionbooleanisChildrenVisited()booleanisVisited()voidpack()booleanremoveSubNode(Node node)Removes a subnodevoidsetBounds(Envelope bounds)voidsetChildrenVisited(boolean childrenVisited)voidsetShapesId(int[] ids)Sets the shape idsvoidsetShapesId(Node other)voidsetVisited(boolean visited)
-
-
-
Constructor Detail
-
Node
public Node(Envelope bounds)
-
-
Method Detail
-
getBounds
public Envelope getBounds()
- Returns:
- Returns the bounds.
-
setBounds
public void setBounds(Envelope bounds)
- Parameters:
bounds- The bounds to set.
-
getNumSubNodes
public int getNumSubNodes()
- Returns:
- Returns the numSubNodes.
-
getNumShapeIds
public int getNumShapeIds()
- Returns:
- Returns the number of records stored.
-
addSubNode
public void addSubNode(Node node)
- Parameters:
node-
-
removeSubNode
public boolean removeSubNode(Node node)
Removes a subnode- Parameters:
node- The subnode to remove- Returns:
- true if the subnode has been removed
-
clearSubNodes
public void clearSubNodes()
-
getSubNode
public Node getSubNode(int pos) throws StoreException
Gets the Node at the requested position- Parameters:
pos- The position- Returns:
- A Node
- Throws:
StoreException
-
addShapeId
public void addShapeId(int id)
Add a shape id
-
getShapeId
public int getShapeId(int pos)
Gets a shape id- Parameters:
pos- The position- Returns:
- The shape id (or recno) at the requested position
-
setShapesId
public void setShapesId(int[] ids)
Sets the shape ids
-
setShapesId
public void setShapesId(Node other)
-
getShapesId
public int[] getShapesId()
- Returns:
- Returns the shapesId.
-
isVisited
public boolean isVisited()
-
setVisited
public void setVisited(boolean visited)
-
isChildrenVisited
public boolean isChildrenVisited()
-
setChildrenVisited
public void setChildrenVisited(boolean childrenVisited)
-
copy
public Node copy() throws IOException
- Throws:
IOException
-
close
public void close()
Clears up whatever resources the node is hanging onto
-
clean
public void clean()
To be used only against in memory nodes, allows to start over on rebuilding this node
-
pack
public void pack()
-
-