diff options
author | Fred Quintana <fredq@google.com> | 2009-12-09 16:00:31 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2009-12-10 10:37:52 -0800 |
commit | 2ec6c5699181316e5a5c2cd293c006ac4a8bb101 (patch) | |
tree | 5dffd05ec1b6cd3630bef911631ef2150904088a /core/java/android/content/Entity.java | |
parent | 8415afdb706c94cc297195a0dd5b5a62726d66e4 (diff) | |
download | frameworks_base-2ec6c5699181316e5a5c2cd293c006ac4a8bb101.zip frameworks_base-2ec6c5699181316e5a5c2cd293c006ac4a8bb101.tar.gz frameworks_base-2ec6c5699181316e5a5c2cd293c006ac4a8bb101.tar.bz2 |
am 328c0e79: - removed the concept of Entity from the ContentProvider APIs - removed the parcelling ability from Entity and EntityIterator and made them public - added an EntityIterator abstract implementation that allow easy wrapping of a Cursor - changed the VCard c
Merge commit '328c0e7986aa6bb7752ec6de3da9c999920bb55f' into eclair-mr2-plus-aosp
* commit '328c0e7986aa6bb7752ec6de3da9c999920bb55f':
- removed the concept of Entity from the ContentProvider APIs
Diffstat (limited to 'core/java/android/content/Entity.java')
-rw-r--r-- | core/java/android/content/Entity.java | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/core/java/android/content/Entity.java b/core/java/android/content/Entity.java index ee8112e..7842de0 100644 --- a/core/java/android/content/Entity.java +++ b/core/java/android/content/Entity.java @@ -24,11 +24,13 @@ import android.util.Log; import java.util.ArrayList; /** - * Objects that pass through the ContentProvider and ContentResolver's methods that deal with - * Entities must implement this abstract base class and thus themselves be Parcelable. - * @hide + * A representation of a item using ContentValues. It contains one top level ContentValue + * plus a collection of Uri, ContentValues tuples as subvalues. One example of its use + * is in Contacts, where the top level ContentValue contains the columns from the RawContacts + * table and the subvalues contain a ContentValues object for each row from the Data table that + * corresponds to that RawContact. The uri refers to the Data table uri for each row. */ -public final class Entity implements Parcelable { +public final class Entity { final private ContentValues mValues; final private ArrayList<NamedContentValues> mSubValues; @@ -49,40 +51,6 @@ public final class Entity implements Parcelable { mSubValues.add(new Entity.NamedContentValues(uri, values)); } - public int describeContents() { - return 0; - } - - public void writeToParcel(Parcel dest, int flags) { - mValues.writeToParcel(dest, 0); - dest.writeInt(mSubValues.size()); - for (NamedContentValues value : mSubValues) { - value.uri.writeToParcel(dest, 0); - value.values.writeToParcel(dest, 0); - } - } - - private Entity(Parcel source) { - mValues = ContentValues.CREATOR.createFromParcel(source); - final int numValues = source.readInt(); - mSubValues = new ArrayList<NamedContentValues>(numValues); - for (int i = 0; i < numValues; i++) { - final Uri uri = Uri.CREATOR.createFromParcel(source); - final ContentValues values = ContentValues.CREATOR.createFromParcel(source); - mSubValues.add(new NamedContentValues(uri, values)); - } - } - - public static final Creator<Entity> CREATOR = new Creator<Entity>() { - public Entity createFromParcel(Parcel source) { - return new Entity(source); - } - - public Entity[] newArray(int size) { - return new Entity[size]; - } - }; - public static class NamedContentValues { public final Uri uri; public final ContentValues values; |