@SuppressWarnings("deprecation") @Override public boolean isNull(int columnIndex) { return window.isNull(position, columnIndex); }
@Override public boolean isNull(int columnIndex) { return window.isNull(position, columnIndex); }
@SuppressWarnings("deprecation") @Override public boolean isNull(int columnIndex) { return window.isNull(position, columnIndex); }
@Override public boolean isNull(int columnIndex) { return window.isNull(position, columnIndex); }
/** * Returns whether the given column at the provided position contains null. * This will throw an {@link IllegalArgumentException} if the column does not exist, the * position is invalid, or the data holder has been closed. * * @param column The column to retrieve. * @param row The row to retrieve the data from. * @param windowIndex Index of the cursor window to extract the data from. * @return Whether the column value is null at this position. */ public boolean isNull(String column, int row, int windowIndex) { return windows[windowIndex].isNull(row, columnIndices.get(column)); }
@SuppressWarnings("deprecation") @SuppressLint("NewApi") static int getCursorType(Cursor cursor, int i) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { return cursor.getType(i); } if (cursor instanceof AbstractWindowedCursor) { CursorWindow cursorWindow = ((AbstractWindowedCursor) cursor).getWindow(); int pos = cursor.getPosition(); int type = -1; if (cursorWindow.isNull(pos, i)) { type = FIELD_TYPE_NULL; } else if (cursorWindow.isLong(pos, i)) { type = FIELD_TYPE_INTEGER; } else if (cursorWindow.isFloat(pos, i)) { type = FIELD_TYPE_FLOAT; } else if (cursorWindow.isString(pos, i)) { type = FIELD_TYPE_STRING; } else if (cursorWindow.isBlob(pos, i)) { type = FIELD_TYPE_BLOB; } return type; } throw new RuntimeException("Unsupported cursor on this platform!"); }
/** * Compat method so we can get type of column on API < 11. * Source: http://stackoverflow.com/a/20685546/2643666 */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static int getColumnType(Cursor cursor, int col) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { SQLiteCursor sqLiteCursor = (SQLiteCursor) cursor; CursorWindow cursorWindow = sqLiteCursor.getWindow(); int pos = cursor.getPosition(); int type = -1; if (cursorWindow.isNull(pos, col)) { type = FIELD_TYPE_NULL; } else if (cursorWindow.isLong(pos, col)) { type = FIELD_TYPE_INTEGER; } else if (cursorWindow.isFloat(pos, col)) { type = FIELD_TYPE_FLOAT; } else if (cursorWindow.isString(pos, col)) { type = FIELD_TYPE_STRING; } else if (cursorWindow.isBlob(pos, col)) { type = FIELD_TYPE_BLOB; } return type; } else { return cursor.getType(col); } } }
if (origin.isNull(i, j)) { destination.putNull(i, j);
destination.putString(cur, i, j); } else if (origin.isNull(i, j)) { destination.putNull(i, j);