public static void cursorShortToContentValuesIfPresent ( Cursor cursor , ContentValues values , String column ) { final int index = cursor . getColumnIndex ( column ) ; if ( index != - 1 && ! cursor . isNull ( index ) ) { values . put ( column , cursor . getShort ( index ) ) ; } }
Reads a Short out of a column in a Cursor and writes it to a ContentValues . Adds nothing to the ContentValues if the column isn t present or if its value is null .