if (leaf) { // leaf node reached!
this.currentLeafIn = in;
while (countDown >= 0.0) {
final DBBPTreeEntry<TripleKey, Triple> e = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextLeafEntry(
in, (this.lastTriple == null) ? null
: new TripleKey(this.lastTriple, LazyLiteralTripleKeyDBBPTreeStatistics.this.order),
this.lastTriple);
if (e == null) {
this.close();
this.next = null;
return null;
}
if (e.key == null) {
// next leaf node, but we do big jumps by going over
// the inner nodes!
// this case should never happen!
if (e.filenameOfNextLeafNode >= 0) {
this.currentLeafIn.close();
return this.useInnerNodes(countDown, pos,
entry, this.innerNodes.size() - 1);
} else {
// should never happen!
this.currentLeafIn.close();
this.close();
this.next = null;
return null;
}
}
if (LazyLiteralTripleKeyDBBPTreeStatistics.this.comparator.compare(e.key, this.arg0) != 0) {
this.close();
this.next = null;
return null;
}
if (this.largest != null) {
if (LazyLiteralTripleKeyDBBPTreeStatistics.this.comparator.compare(e.key, this.largest) > 0) {
this.close();
this.next = null;
return null;
}
}
entry.selectivity += 1.0;
countDown -= 1.0;
if (this.lastTriple == null
|| this.lastTriple
.getPos(pos)
.compareToNotNecessarilySPARQLSpecificationConform(
e.value.getPos(pos)) != 0) {
entry.distinctLiterals += 1.0;
}
this.lastTriple = e.value;
entry.literal = this.lastTriple.getPos(pos);
}
// read over the triples with the same literal at position
// pos
return this.readOver(this.lastTriple, entry, pos);
} else {
TripleKey lastKey = null;
while (true) {
final InnerNodeEntry nextEntry = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextInnerNodeEntryStatistics(
lastKey, in);
if (nextEntry == null || nextEntry.fileName <= 0) {
in.close();