|
|
|
@ -816,18 +816,10 @@ public class kelondroTree extends kelondroRecords implements kelondroIndex {
|
|
|
|
|
Iterator ii;
|
|
|
|
|
Node nextNode;
|
|
|
|
|
boolean asc, rot;
|
|
|
|
|
Node start;
|
|
|
|
|
byte[] firstKey;
|
|
|
|
|
|
|
|
|
|
public correctedNodeIterator(boolean up, boolean rotating, Node start, byte[] firstKey) throws IOException {
|
|
|
|
|
asc = up;
|
|
|
|
|
rot = rotating;
|
|
|
|
|
this.start = start;
|
|
|
|
|
this.firstKey = firstKey;
|
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void init() throws IOException {
|
|
|
|
|
this.asc = up;
|
|
|
|
|
this.rot = rotating;
|
|
|
|
|
ii = new nodeIterator(asc, rot, start);
|
|
|
|
|
nextNode = (ii.hasNext()) ? (Node) ii.next() : null;
|
|
|
|
|
if (nextNode != null) {
|
|
|
|
@ -859,7 +851,7 @@ public class kelondroTree extends kelondroRecords implements kelondroIndex {
|
|
|
|
|
// correct wrong order (this should not happen)
|
|
|
|
|
if (rot) {
|
|
|
|
|
try {
|
|
|
|
|
init();
|
|
|
|
|
ii = new nodeIterator(asc, rot);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
nextNode = null;
|
|
|
|
|
}
|
|
|
|
|