If you think the Android project Jello listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.atteo.jello.space;
//fromwww.java2s.comimport com.atteo.jello.Record;
import com.atteo.jello.store.ListPage;
import com.atteo.jello.store.PagedFile;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
@Singleton
publicclass SpaceManagerNative implements SpaceManager {
// TODO: currently keeps all freeSpaceInfo pages in memory
static {
System.loadLibrary("SpaceManagerNative");
}
@Inject
public SpaceManagerNative(
final PagedFile pagedFile,
final ListPage listPage,
@Named("freeSpaceInfoSize") finalshort freeSpaceInfoSize,
@Named("freeSpaceInfosPerPage") finalshort freeSpaceInfosPerPage,
@Named("freeSpaceInfoPageCapacity") finalshort freeSpaceInfoPageCapacity,
@Named("blockSize") finalshort blockSize,
@Named("freeSpaceInfoPageId") finalint freeSpaceInfoPageId) {
init(pagedFile, listPage, freeSpaceInfosPerPage, freeSpaceInfoSize,
freeSpaceInfoPageCapacity, freeSpaceInfoPageId, blockSize);
}
publicnativevoid commit();
publicnativevoid create();
publicnativeshort freeSpaceOnPage(int id);
publicnativevoid init(PagedFile pagedFile, ListPage listPage,
short freeSpaceInfosPerPage, short freeSpaceInfoSize,
short freeSpaceInfoPageCapacity, int freeSpaceInfoPageId,
short blockSize);
publicnativeboolean isBlockUsed(int id, short block);
publicnativeboolean isPageUsed(int id);
publicnativeboolean load();
publicnativevoid setBlockUsed(int id, short block, boolean used);
publicnativevoid setPageUsed(int id, boolean used);
publicnativevoid setRecordUsed(Record record, boolean used);
publicnativelong totalFreeSpace();
publicnativevoid update();
}