Code example for CursorWindow

Methods: allocRowcleargetNumRowsputBlobputLongsetNumColumnssetStartPosition

0
    @Override 
    public boolean onMove(int oldPosition, int newPosition) {
        boolean bRet = true;
 
        // get rid of old data 
        mWindow.clear();
        bRet = mWindow.setNumColumns(theColumns.length);
        fillWindow(newPosition, mWindow);
 
        return bRet;
    } 
 
    @Override 
    public void fillWindow (int pos, CursorWindow window) {
        int    nNumRows = window.getNumRows();
        int nCIndex = 0;
        window.setStartPosition(0);
 
        if (pos > -1) {
            if (nNumRows == 0) {
                window.allocRow();
                nNumRows = window.getNumRows();
            } 
 
            if (nNumRows == 1) {
                nCIndex = getColumnIndex(LENGTH);
                if (nCIndex > -1) {
                    window.putLong(lFileSize, 0, nCIndex);
                } 
                nCIndex = getColumnIndex(_ID);
                if (nCIndex > -1) {
                    window.putLong((long)pos, 0, nCIndex);
                } 
                nCIndex = getColumnIndex(CHUNK);
                if (nCIndex > -1) {
                    if (lLength != 0) {
                        byte[] value = getABlob (pos, 1);
                        window.putBlob(value, 0, nCIndex);
                    } 
                } 
            } 
            window.setStartPosition(pos);
        } 
        return; 
    } 
 
    public byte[] getABlob (int row, int column) {
Contextual code suggestions in your IDE  Get Codota for Java