Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.gawst.asyncdb;
 
 import  android.database.sqlite.SQLiteOpenHelper;
 
A SQLiteOpenHelper class with a worker thread for all disk work. Elements are not stored in memory.

Parameters:
<E> Type of Objects that are stored in the main table
public abstract class AsynchronousDatabase<E, INSERT_ID> extends AsynchronousDbHelper<E, INSERT_ID> {

Constructor for the SQLite database with a worker thread

Parameters:
db The already created android.database.sqlite.SQLiteOpenHelper to use as storage
name Database name for logs
logger The Logger to use for all logs (can be null for the default Android logs)
	public AsynchronousDatabase(DataSource<E, INSERT_ID> dbString nameLogger logger) {
		super(dbnameloggernull);
	}
	public final void addItemInMemory(E item) {
		// do nothing
	}
	protected final boolean shouldReloadAllData() {
		return false;
	}
	protected boolean notifyOnSchedule() {
		return false;
	}

Add a new element in the database (asynchronous)

Helper call for AsynchronousDbHelper.scheduleAddOperation(Object, org.gawst.asyncdb.purge.PurgeHandler)

If adding failed AsynchronousDbErrorHandler.onAddItemFailed() will be called

Parameters:
item to add
See also:
AsynchronousDbHelper.scheduleAddOperation(Object, org.gawst.asyncdb.purge.PurgeHandler)
	public void add(E item) {
	}

Add new elements in the database (asynchronous)

Helper call for AsynchronousDbHelper.scheduleAddOperation(java.util.Collection, org.gawst.asyncdb.purge.PurgeHandler)

AsynchronousDbErrorHandler.onAddItemFailed() will be called for each addition failure

Parameters:
items to add
See also:
AsynchronousDbHelper.scheduleAddOperation(java.util.Collection, org.gawst.asyncdb.purge.PurgeHandler)
	public void addAll(Collection<E> items) {
	}

Update an element in the database

Helper call for scheduleUpdateOperation(E)

Parameters:
item to update
See also:
scheduleUpdateOperation(E)
	public void update(E item) {
	}

Remove an element from the database (asynchronous)

Helper call for scheduleRemoveOperation(E)

If the removal fails AsynchronousDbErrorHandler.onRemoveItemFailed() will be called

Parameters:
item to remove
See also:
scheduleRemoveOperation(E)
	public void remove(E item) {
	}
New to GrepCode? Check out our FAQ X