• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java CrossProcessCursor类的典型用法和代码示例

java 13次浏览

本文整理汇总了Java中android.database.CrossProcessCursor的典型用法代码示例。如果您正苦于以下问题:Java CrossProcessCursor类的具体用法?Java CrossProcessCursor怎么用?Java CrossProcessCursor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

CrossProcessCursor类属于android.database包,在下文中一共展示了CrossProcessCursor类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadAllFromCursor

点赞 3

import android.database.CrossProcessCursor; //导入依赖的package包/类
private ArrayList<V> loadAllFromCursor(Cursor cursor) {
    int count = cursor.getCount();
    ArrayList<V> list = new ArrayList<V>(count);
    if (cursor instanceof CrossProcessCursor) {
        CursorWindow window = ((CrossProcessCursor) cursor).getWindow();
        if (window != null) {
            if (window.getNumRows() == count) {
                cursor = new FastCursor(window);
            }
        }
    }

    final long start = System.currentTimeMillis();
    if (cursor.moveToFirst()) {
        do {
            list.add(loadCurrent(cursor));
        } while (cursor.moveToNext());
    }
    return list;
}
 

开发者ID:actorapp,
项目名称:droidkit-engines,
代码行数:21,
代码来源:AbstractDao.java

示例2: moveToNextUnlocked

点赞 2

import android.database.CrossProcessCursor; //导入依赖的package包/类
/**
 * Unlock identityScope during cursor.moveToNext() when it is about to fill the window (needs a db connection):
 * We should not hold the lock while trying to acquire a db connection to avoid deadlocks.
 */
private CursorWindow moveToNextUnlocked(Cursor cursor) {
    identityScope.unlock();
    try {
        if (cursor.moveToNext()) {
            return ((CrossProcessCursor) cursor).getWindow();
        } else {
            return null;
        }
    } finally {
        identityScope.lock();
    }
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:17,
代码来源:AbstractDao.java

示例3: fillWindow

点赞 2

import android.database.CrossProcessCursor; //导入依赖的package包/类
@Override
public void fillWindow(int position, CursorWindow window) {
    if (mCursor instanceof CrossProcessCursor) {
        final CrossProcessCursor crossProcessCursor = (CrossProcessCursor)mCursor;
        crossProcessCursor.fillWindow(position, window);
        return;
    }

    DatabaseUtils.cursorFillWindow(mCursor, position, window);
}
 

开发者ID:doppllib,
项目名称:core-doppl,
代码行数:11,
代码来源:CrossProcessCursorWrapper.java

示例4: getWindow

点赞 2

import android.database.CrossProcessCursor; //导入依赖的package包/类
@Override
public CursorWindow getWindow() {
    if (mCursor instanceof CrossProcessCursor) {
        final CrossProcessCursor crossProcessCursor = (CrossProcessCursor)mCursor;
        return crossProcessCursor.getWindow();
    }

    return null;
}
 

开发者ID:doppllib,
项目名称:core-doppl,
代码行数:10,
代码来源:CrossProcessCursorWrapper.java

示例5: onMove

点赞 2

import android.database.CrossProcessCursor; //导入依赖的package包/类
@Override
public boolean onMove(int oldPosition, int newPosition) {
    if (mCursor instanceof CrossProcessCursor) {
        final CrossProcessCursor crossProcessCursor = (CrossProcessCursor)mCursor;
        return crossProcessCursor.onMove(oldPosition, newPosition);
    }

    return true;
}
 

开发者ID:doppllib,
项目名称:core-doppl,
代码行数:10,
代码来源:CrossProcessCursorWrapper.java

示例6: loadAllFromCursor

点赞 2

import android.database.CrossProcessCursor; //导入依赖的package包/类
/** Reads all available rows from the given cursor and returns a list of entities. */
protected List<T> loadAllFromCursor(Cursor cursor) {
    int count = cursor.getCount();
    List<T> list = new ArrayList<T>(count);
    if (cursor instanceof CrossProcessCursor) {
        CursorWindow window = ((CrossProcessCursor) cursor).getWindow();
        if (window != null) { // E.g. Roboelectric has no Window at this point
            if (window.getNumRows() == count) {
                cursor = new FastCursor(window);
            } else {
                DaoLog.w("Window vs. result size: " + window.getNumRows() + "/" + count);
            }
        }
    }

    if (cursor.moveToFirst()) {
        if (identityScope != null) {
            identityScope.lock();
            identityScope.reserveRoom(count);
        }
        try {
            do {
                list.add(loadCurrent(cursor, 0, false));
            } while (cursor.moveToNext());
        } finally {
            if (identityScope != null) {
                identityScope.unlock();
            }
        }
    }
    return list;
}
 

开发者ID:itsmechlark,
项目名称:greendao-cipher,
代码行数:33,
代码来源:AbstractDao.java

示例7: fillWindow

点赞 2

import android.database.CrossProcessCursor; //导入依赖的package包/类
@Override
public void fillWindow(int position, CursorWindow window) {
	if (mCursor instanceof CrossProcessCursor) {
		final CrossProcessCursor crossProcessCursor = (CrossProcessCursor) mCursor;
		crossProcessCursor.fillWindow(position, window);
		return;
	}

	cursorFillWindow(mCursor, position, window);
}
 

开发者ID:ProjectMAXS,
项目名称:maxs,
代码行数:11,
代码来源:CrossProcessCursorWrapper.java

示例8: getWindow

点赞 2

import android.database.CrossProcessCursor; //导入依赖的package包/类
@Override
public CursorWindow getWindow() {
	if (mCursor instanceof CrossProcessCursor) {
		final CrossProcessCursor crossProcessCursor = (CrossProcessCursor) mCursor;
		return crossProcessCursor.getWindow();
	}

	return null;
}
 

开发者ID:ProjectMAXS,
项目名称:maxs,
代码行数:10,
代码来源:CrossProcessCursorWrapper.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)