|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--com.syncbuilder.storage.DatabaseBase
|
+--com.syncbuilder.storage.MemoryDatabase
A representation of an in-memory database.
MemoryDatabase supports all the functionality that is specified in the
Database interface.
Database,
DatabaseBase| Fields inherited from class com.syncbuilder.storage.DatabaseBase |
_creator,
_dbimpl,
_dbmode,
_dbname |
| Constructor Summary | |
MemoryDatabase(Char4 creator,
java.lang.String dbname,
int dbmode)
Construct an empty MemoryDatabase object. This constructor tries to figure out the proper version of DatabaseImpl by querying the DatabaseImplFactory. |
|
MemoryDatabase(DatabaseImpl dbimpl,
int dbmode)
Construct an empty MemoryDatabase object. |
|
| Method Summary | |
void |
close()
Closes the database. |
void |
deleteAllRecords()
Delete ALL records in the database. |
void |
deleteAllResources()
Delete ALL resources. |
void |
deleteCategory(int category)
Delete all records from a specified category |
void |
deleteRecord(RecordID uid)
Delete the record with the specified UID from the database. |
void |
deleteResource(Char4 type,
int id)
|
AppBlock |
getAppBlock()
|
DBInfo |
getDBInfo()
Return meta-information about the Database Caution! |
Record |
getNextModifiedRecord()
|
Record |
getNextModifiedRecord(int category)
|
Record |
getNextRecord(int category)
|
Pref |
getPref(int id,
boolean backed_up)
Get one of the preferences which are associated with the same app as the database. |
Record |
getRecord(int index)
|
Record |
getRecord(RecordID uid)
|
int |
getRecordCount()
Return the number of records in the Database |
RecordID[] |
getRecordIDs(boolean sort,
int start,
int max)
Return the UIDs of selected records in the DB. |
Resource |
getResource(Char4 type,
int id)
|
Resource |
getResource(int index)
|
SortBlock |
getSortBlock()
|
void |
moveCategory(int from,
int to)
|
void |
moveRecord(int from,
int to)
Move a record from one position to another. |
void |
purgeRecords()
Deletes all records which are marked as archived or deleted |
void |
putRecord(Record record)
Writes a record to the database. |
void |
putResource(Resource resource)
|
void |
resetFlags()
For record databases, reset all dirty flags. |
void |
resetNext()
Resets the "next record" index to the beginning |
void |
setAppBlock(AppBlock appblock)
|
void |
setDBInfo(DBInfo dbinfo)
Associate a complete set of meta-information with the Database. |
void |
setPref(Pref pref)
Store a Pref which is associated with the same app as the database to the database. |
void |
setSortBlock(SortBlock sortblock)
|
| Methods inherited from class com.syncbuilder.storage.DatabaseBase |
createAppBlock,
createPref,
createPref,
createRecord,
createRecord,
createRecord,
createResource,
createResource,
createResource,
createSortBlock,
finalize,
getPref,
getRecordIDs,
getRecordIDs,
getRecordIDs |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MemoryDatabase(Char4 creator,
java.lang.String dbname,
int dbmode)
creator - the creator ID of the databasedbname - the name of the databasedbmode - the mode of the database, use the Database.OPEN_XXX-flags
public MemoryDatabase(DatabaseImpl dbimpl,
int dbmode)
dbimpl - the DatabaseImpl to be useddbmode - the mode of the database, use the Database.OPEN_XXX-flags| Method Detail |
public AppBlock getAppBlock()
throws DatabaseException
public void setAppBlock(AppBlock appblock)
throws DatabaseException
public SortBlock getSortBlock()
throws DatabaseException
public void setSortBlock(SortBlock sortblock)
throws DatabaseException
public Record getRecord(int index)
throws DatabaseException
public Record getRecord(RecordID uid)
throws DatabaseException
public Record getNextRecord(int category)
throws DatabaseException
public Record getNextModifiedRecord()
throws DatabaseException
public Record getNextModifiedRecord(int category)
throws DatabaseException
public void resetNext()
throws DatabaseException
public void putRecord(Record record)
throws DatabaseException
public void deleteRecord(RecordID uid)
throws DatabaseException
uid - the UID (not the index!) of the record
public void deleteAllRecords()
throws DatabaseException
public void deleteCategory(int category)
throws DatabaseException
category - the category
public void moveCategory(int from,
int to)
throws DatabaseException
public RecordID[] getRecordIDs(boolean sort,
int start,
int max)
throws DatabaseException
sort - will be ignoredstart - the index of the first returned recordmax - the maximum number of returned results
public void purgeRecords()
throws DatabaseException
public void moveRecord(int from,
int to)
throws DatabaseException
public Resource getResource(int index)
throws DatabaseException
public Resource getResource(Char4 type,
int id)
throws DatabaseException
public void putResource(Resource resource)
throws DatabaseException
public void deleteResource(Char4 type,
int id)
throws DatabaseException
public void deleteAllResources()
throws DatabaseException
public Pref getPref(int id,
boolean backed_up)
throws DatabaseException,
NoCreatorException
public void setPref(Pref pref)
throws DatabaseException
public void close()
throws DatabaseException
public void resetFlags()
throws DatabaseException
public int getRecordCount()
throws DatabaseException
public DBInfo getDBInfo()
throws DatabaseException
public void setDBInfo(DBInfo dbinfo)
throws DatabaseException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||