@Override
public DataRecordIdentifier nextDataRecordIdentifier(
final DataRecordIdentifier dataRecordIdentifier)
throws HeapException {
final HeapIdNode currentHeapIdNode;
try {
currentHeapIdNode = (HeapIdNode) idNodeSearchMayBeNotExist(dataRecordIdentifier);
} catch (HeapException exception) {
final String message = "failed get current node";
logger.fatal(message);
throw new HeapException(message, exception);
}
final HeapIdNode nextHeapIdNode;
try {
nextHeapIdNode = (HeapIdNode) idNodeTree.next(currentHeapIdNode);
} catch (RBTException exception) {
final String message = "failed get next node";
logger.fatal(message);
throw new HeapException(message, exception);
}
final DataRecordIdentifier element;
if (nextHeapIdNode == null) {
element = null;
} else {
element = nextHeapIdNode.getElement();
}
return element;
}