int (int enumeratorId) { if (enumeratorId == NULL_ID) { return NULL_ID; } int logHeaderSize = AppendOnlyLogOverMMappedFile.HeaderLayout.HEADER_SIZE; int offset = (enumeratorId - 1) + logHeaderSize; int pageNo = offset / pageSize; if (pageNo == 0) { return (enumeratorId - 1) / HASH_RECORD_LENGTH + 1; } else { int offsetOnPage = offset % pageSize; int recordsOnPage = pageSize / HASH_RECORD_LENGTH; int recordsOnFirstPage = (pageSize - logHeaderSize) / HASH_RECORD_LENGTH; return recordsOnPage * (pageNo - 1) + recordsOnFirstPage + offsetOnPage / HASH_RECORD_LENGTH + 1; } }