public Node copy() throws IOException { FileSystemNode copy = new FileSystemNode(getBounds(), id, getParent(), buffer, subNodeStartByte, subNodesLength ); copy.numShapesId=numShapesId; copy.shapesId=new int [numShapesId]; System.arraycopy(shapesId, 0, copy.shapesId, 0, numShapesId); copy.numSubNodes=numSubNodes; return copy; } /**
/** * DOCUMENT ME! * * @param channel * @param order DOCUMENT ME! * * * @throws IOException */ public static FileSystemNode readNode(int id, Node parent, FileChannel channel, ByteOrder order) throws IOException { ScrollingBuffer buffer = new ScrollingBuffer(channel, order); return readNode(id, parent, buffer); }
public Node copy() throws IOException { FileSystemNode copy = new FileSystemNode(getBounds(), buffer, subNodeStartByte, subNodesLength); copy.numShapesId = numShapesId; copy.shapesId = new int[numShapesId]; System.arraycopy(shapesId, 0, copy.shapesId, 0, numShapesId); copy.numSubNodes = numSubNodes; return copy; }
/** * @see org.geotools.index.quadtree.Node#getSubNode(int) */ public Node getSubNode(int pos) throws StoreException { if (this.subNodes.size() > pos) { return super.getSubNode(pos); } try { FileSystemNode subNode = null; // Getting prec subNode... int offset = this.subNodeStartByte; if (pos > 0) { subNode = (FileSystemNode) getSubNode(pos - 1); offset = subNode.getSubNodeStartByte() + subNode.getSubNodesLength(); } buffer.goTo(offset); for (int i = 0, ii = subNodes.size(); i < ((pos + 1) - ii); i++) { subNode = readNode(pos, this, buffer); this.addSubNode(subNode); } } catch (IOException e) { throw new StoreException(e); } return super.getSubNode(pos); }
static FileSystemNode readNode(int id, Node parent, ScrollingBuffer buf) throws IOException { // offset int offset = buf.getInt(); // envelope Envelope env = buf.getEnvelope(); // shapes in this node int numShapesId = buf.getInt(); int[] ids = null; if(numShapesId > 0) { ids = new int[numShapesId]; buf.getIntArray(ids); } else { ids = ZERO; } int numSubNodes = buf.getInt(); // let's create the new node FileSystemNode node = new FileSystemNode(env, buf, (int) buf.getPosition(), offset); node.setShapesId(ids); node.setNumSubNodes(numSubNodes); return node; }
/** * @see org.geotools.index.quadtree.Node#getSubNode(int) */ public Node getSubNode(int pos) throws StoreException { if (this.subNodes.size() > pos) { return super.getSubNode(pos); } try { FileSystemNode subNode = null; // Getting prec subNode... int offset = this.subNodeStartByte; if (pos > 0) { subNode = (FileSystemNode) getSubNode(pos - 1); offset = subNode.getSubNodeStartByte() + subNode.getSubNodesLength(); } buffer.goTo(offset); for (int i = 0, ii = subNodes.size(); i < ((pos + 1) - ii); i++) { subNode = readNode(pos, this, buffer); this.addSubNode(subNode); } } catch (IOException e) { throw new StoreException(e); } return super.getSubNode(pos); }
static FileSystemNode readNode(int id, Node parent, ScrollingBuffer buf) throws IOException { // offset int offset = buf.getInt(); // envelope Envelope env = buf.getEnvelope(); // shapes in this node int numShapesId = buf.getInt(); int[] ids = null; if(numShapesId > 0) { ids = new int[numShapesId]; buf.getIntArray(ids); } else { ids = ZERO; } int numSubNodes = buf.getInt(); // let's create the new node FileSystemNode node = new FileSystemNode(env, buf, (int) buf.getPosition(), offset); node.setShapesId(ids); node.setNumSubNodes(numSubNodes); return node; }
public Node copy() throws IOException { FileSystemNode copy = new FileSystemNode(getBounds(), buffer, subNodeStartByte, subNodesLength); copy.numShapesId = numShapesId; copy.shapesId = new int[numShapesId]; System.arraycopy(shapesId, 0, copy.shapesId, 0, numShapesId); copy.numSubNodes = numSubNodes; return copy; }
/** * @see org.geotools.index.quadtree.Node#getSubNode(int) */ public Node getSubNode(int pos) throws StoreException { if (this.subNodes.size() > pos) { return super.getSubNode(pos); } try { FileSystemNode subNode = null; // Getting prec subNode... int offset = this.subNodeStartByte; if (pos > 0) { subNode = (FileSystemNode) getSubNode(pos - 1); offset = subNode.getSubNodeStartByte() + subNode.getSubNodesLength(); } buffer.goTo(offset); for (int i = 0, ii = subNodes.size(); i < ((pos + 1) - ii); i++) { subNode = readNode(pos, this, buffer); this.addSubNode(subNode); } } catch (IOException e) { throw new StoreException(e); } return super.getSubNode(pos); }
static FileSystemNode readNode(int id, Node parent, ScrollingBuffer buf) throws IOException { // offset int offset = buf.getInt(); double x1; double y1; double x2; double y2; // envelope x1 = buf.getDouble(); y1 = buf.getDouble(); x2 = buf.getDouble(); y2 = buf.getDouble(); Envelope env = new Envelope(x1, x2, y1, y2); // shapes in this node int numShapesId = buf.getInt(); int[] ids = new int[numShapesId]; buf.getIntArray(ids); int numSubNodes = buf.getInt(); // let's create the new node FileSystemNode node = new FileSystemNode(env, id, parent, buf, (int) buf.getPosition(), offset); node.setShapesId(ids); node.setNumSubNodes(numSubNodes); return node; }
/** * DOCUMENT ME! * * @param channel * @param order * DOCUMENT ME! * * * @throws IOException */ public static FileSystemNode readNode(int id, Node parent, FileChannel channel, ByteOrder order, boolean useMemoryMapping) throws IOException { ScrollingBuffer buffer = new ScrollingBuffer(channel, order, useMemoryMapping); return readNode(id, parent, buffer); }
/** * DOCUMENT ME! * * @param channel * @param order * DOCUMENT ME! * * * @throws IOException */ public static FileSystemNode readNode(int id, Node parent, FileChannel channel, ByteOrder order, boolean useMemoryMapping) throws IOException { ScrollingBuffer buffer = new ScrollingBuffer(channel, order, useMemoryMapping); return readNode(id, parent, buffer); }
tree.setRoot(FileSystemNode.readNode(0, null, channel, order, useMemoryMapping));
tree.setRoot(FileSystemNode.readNode(0, null, channel, order));
tree.setRoot(FileSystemNode.readNode(0, null, channel, order, useMemoryMapping));