Android Open Source - InMemoryDb Content Provider Data Source






From Project

Back to project page InMemoryDb.

License

The source code is released under:

Apache License

If you think the Android project InMemoryDb 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 org.gawst.asyncdb.source;
/*from w w w . j  a v a  2  s  .co m*/
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.support.annotation.NonNull;

import org.gawst.asyncdb.source.typed.TypedContentProviderDataSource;

/**
 * A {@link org.gawst.asyncdb.DataSource} reading/writing data using a {@link android.content.ContentProvider ContentProvider}
 * @param <E> Type of the elements read from the {@code Cursor}
 */
public class ContentProviderDataSource<E> extends TypedContentProviderDataSource<E, Cursor> implements DatabaseSource<Uri, Uri> {
  /**
   * Contructor.
   * @param contentResolver ContentResolver used to access the {@link android.content.ContentProvider ContentProvider}
   * @param contentProviderUri {@link android.net.Uri Uri} to access the data from the {@link android.content.ContentProvider ContentProvider}
   * @param databaseElementHandler Handler to transform {@link E} elements to queries and {@code Cursor} to {@link E} elements.
   */
  public ContentProviderDataSource(@NonNull ContentResolver contentResolver, @NonNull Uri contentProviderUri, @NonNull DatabaseElementHandler<E> databaseElementHandler) {
    super(contentResolver, contentProviderUri, databaseElementHandler);
  }

  /**
   * Contructor.
   * @param context Context used to get the {@link android.content.ContentResolver ContentResolver} used to access the {@link android.content.ContentProvider ContentProvider}
   * @param contentProviderUri {@link android.net.Uri Uri} to access the data from the {@link android.content.ContentProvider ContentProvider}
   * @param databaseElementHandler Handler to transform {@link E} elements to queries and {@code Cursor} to {@link E} elements.
   */
  public ContentProviderDataSource(@NonNull Context context, @NonNull Uri contentProviderUri, @NonNull DatabaseElementHandler<E> databaseElementHandler) {
    super(context, contentProviderUri, databaseElementHandler);
  }

  @Override
  public Cursor wrapCursor(Cursor cursor) {
    return cursor;
  }
}




Java Source Code List

org.gawst.asyncdb.AsyncDatabaseHandler.java
org.gawst.asyncdb.AsyncDbHelperHandler.java
org.gawst.asyncdb.AsyncQueryHandler.java
org.gawst.asyncdb.AsynchronousDatabase.java
org.gawst.asyncdb.AsynchronousDbErrorHandler.java
org.gawst.asyncdb.AsynchronousDbHelper.java
org.gawst.asyncdb.AsynchronousDbOperation.java
org.gawst.asyncdb.DataSource.java
org.gawst.asyncdb.InMemoryDbArrayList.java
org.gawst.asyncdb.InMemoryDbCopyOnWriteArrayList.java
org.gawst.asyncdb.InMemoryDbList.java
org.gawst.asyncdb.InMemoryDbListener.java
org.gawst.asyncdb.InMemoryDbMap.java
org.gawst.asyncdb.InMemoryDbSet.java
org.gawst.asyncdb.InMemoryDbTreeSet.java
org.gawst.asyncdb.InMemoryHashmapDb.java
org.gawst.asyncdb.InMemoryLruCache.java
org.gawst.asyncdb.InvalidDbEntry.java
org.gawst.asyncdb.InvalidEntry.java
org.gawst.asyncdb.LogManager.java
org.gawst.asyncdb.Logger.java
org.gawst.asyncdb.LruCache.java
org.gawst.asyncdb.MapDataSource.java
org.gawst.asyncdb.MapDatabaseElementHandler.java
org.gawst.asyncdb.MapEntry.java
org.gawst.asyncdb.adapter.InMemoryArrayListAdapter.java
org.gawst.asyncdb.adapter.InMemoryFilteredAdapter.java
org.gawst.asyncdb.adapter.InMemoryFilteredListAdapter.java
org.gawst.asyncdb.adapter.InMemoryFilteredTreeAdapter.java
org.gawst.asyncdb.adapter.InMemoryTreeSetAdapter.java
org.gawst.asyncdb.adapter.UIHandler.java
org.gawst.asyncdb.purge.DatabasePurgerMaxDate.java
org.gawst.asyncdb.purge.DatabaseSourcePurgerMax.java
org.gawst.asyncdb.purge.DatabaseSourcePurger.java
org.gawst.asyncdb.purge.PurgeHandler.java
org.gawst.asyncdb.source.ContentProviderDataSource.java
org.gawst.asyncdb.source.CursorDataSource.java
org.gawst.asyncdb.source.DatabaseElementHandler.java
org.gawst.asyncdb.source.DatabaseSource.java
org.gawst.asyncdb.source.SqliteDataSource.java
org.gawst.asyncdb.source.SqliteMapDataSource.java
org.gawst.asyncdb.source.typed.TypedContentProviderDataSource.java
org.gawst.asyncdb.source.typed.TypedCursorDataSource.java
org.gawst.asyncdb.source.typed.TypedDatabaseElementHandler.java
org.gawst.asyncdb.source.typed.TypedDatabaseSource.java
org.gawst.asyncdb.source.typed.TypedSqliteDataSource.java
org.gawst.asyncdb.source.typed.TypedSqliteMapDataSource.java