DataChunk entry = myEntries.get(currentEntry + 1); // look at the next one if (debugChunkOrder) System.out.printf(" Entry=%d: Tile ending order= %d%n", currentEntry, tiling.order(entry.offset)); if ((wantOrigin == null) || tiling.compare(wantOrigin, entry.offset) < 0) break; Misc.showInts(offset[currentEntry]), tiling.order(offset[currentEntry]), tiling.order(offset[currentEntry + 1])); if ((wantOrigin == null) || tiling.compare(wantOrigin, offset[currentEntry + 1]) < 0) { currentNode = new Node(childPointer[currentEntry], this.address); if (debugChunkOrder) System.out.printf("Level %d use entry= %d%n", level, currentEntry);
DataChunk entry = myEntries.get(currentEntry + 1); // look at the next one if (debugChunkOrder) System.out.printf(" Entry=%d: Tile ending order= %d%n", currentEntry, tiling.order(entry.offset)); if ((wantOrigin == null) || tiling.compare(wantOrigin, entry.offset) < 0) break; for (currentEntry = 0; currentEntry < nentries; currentEntry++) { if (debugChunkOrder) System.out.printf(" Entry=%d: Tile order %d-%d%n", currentEntry, tiling.order(offset[currentEntry]), tiling.order(offset[currentEntry + 1])); if ((wantOrigin == null) || tiling.compare(wantOrigin, offset[currentEntry + 1]) < 0) { currentNode = new Node(childPointer[currentEntry], this.address); if (debugChunkOrder) System.out.printf("Level %d use entry= %d%n", level, currentEntry);
void first(int[] wantOrigin) throws IOException { if (level == 0) { currentEntry = 0; /* note nentries-1 - assume dont skip the last one for (currentEntry = 0; currentEntry < nentries-1; currentEntry++) { DataChunk entry = myEntries.get(currentEntry + 1); if ((wantOrigin == null) || tiling.compare(wantOrigin, entry.offset) < 0) break; // LOOK ?? } */ } else { currentNode = null; for (currentEntry = 0; currentEntry < nentries; currentEntry++) { if ((wantOrigin == null) || tiling.compare(wantOrigin, offset[currentEntry + 1]) < 0) { currentNode = new Node(childPointer[currentEntry], this.address); currentNode.first(wantOrigin); break; } } // heres the case where its the last entry we want; the tiling.compare() above may fail if (currentNode == null) { currentEntry = nentries - 1; currentNode = new Node(childPointer[currentEntry], this.address); currentNode.first(wantOrigin); } } //if (currentEntry >= nentries) // System.out.println("hah"); assert (nentries == 0) || (currentEntry < nentries) : currentEntry + " >= " + nentries; }