微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.content.Entity的实例源码

项目:Prevail    文件CursorEntityIterator.java   
/**
 * Returns the next object in the iteration,i.e. returns the element in front of the iterator and advances the iterator by one position.
 *
 * @return the next object.
 * @throws java.util.NoSuchElementException if there are no more elements.
 * @see android.content.EntityIterator#hasNext()
 */
@Override
public final Entity next() {
  if (mIsClosed) {
    throw new IllegalStateException("calling next() when the iterator is closed");
  }
  if (!hasNext()) {
    throw new IllegalStateException("you may only call next() if hasNext() is true");
  }

  try {
    return getEntityAndIncrementCursor(mCursor);
  } catch (remoteexception e) {
    throw new RuntimeException("caught a remote exception,this process will die soon",e);
  }
}
项目:silent-contacts-android    文件RawContact.java   
public static RawContact createFrom(Entity entity) {
    final ContentValues values = entity.getEntityValues();
    final ArrayList<Entity.NamedContentValues> subValues = entity.getSubValues();

    RawContact rawContact = new RawContact(null,values);
    for (Entity.NamedContentValues subValue : subValues) {
        rawContact.addNamedDataItemValues(subValue.uri,subValue.values);
    }
    return rawContact;
}
项目:silent-contacts-android    文件RawContactDeltaList.java   
/**
 * Create an {@link RawContactDeltaList} that contains the entities of the Iterator as before
 * values.  This function can be passed an iterator of Entity objects or an iterator of
 * RawContact objects.
 */
public static RawContactDeltaList fromIterator(Iterator<?> iterator) {
    final RawContactDeltaList state = new RawContactDeltaList();
    // Perform background query to pull contact details
    while (iterator.hasNext()) {
        // Read all contacts into local deltas to prepare for edits
        Object nextObject = iterator.next();
        final RawContact before = nextObject instanceof Entity
                ? RawContact.createFrom((Entity) nextObject)
                : (RawContact) nextObject;
        final RawContactDelta rawContactDelta = RawContactDelta.fromBefore(before);
        state.add(rawContactDelta);
    }
    return state;
}
项目:Feeds    文件PersistentEntity.java   
protected PersistentEntity(Entity instance) {
    this(instance.getEntityValues());
}
项目:Feeds    文件PersistentEntity.java   
protected PersistentEntity(ContentValues contentValues) {
    INSTANCE = new Entity(new ContentValues());
}
项目:Prevail    文件CursorEntityIterator.java   
/**
 * Returns the entity that the cursor is currently pointing to. This must take care to advance the cursor past this entity. This will never be called if the cursor is at the end.
 *
 * @param cursor the cursor that contains the entity rows
 *
 * @return the entity that the cursor is currently pointing to
 * @throws android.os.remoteexception if a remoteexception is caught while attempting to build the Entity
 */
public abstract Entity getEntityAndIncrementCursor(Cursor cursor) throws remoteexception;

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。