private void buildCursorConditionally(MatrixCursor cursor,CharacterRecord cr,String selection,String[] selectionArgs){
  if (selectionArgs == null)   cursor.addRow(new Object[]{cr.getId(),cr.getName(),cr.getRace()});
 else   for (  String item : selectionArgs)   if ((selection.equals(CharacterContract.CharacterEntry.COLUMN_NAME) && item.equals(cr.getName())) || (selection.equals(CharacterContract.CharacterEntry.COLUMN_RACE) && item.equals(cr.getRace()))) {
    cursor.addRow(new Object[]{cr.getId(),cr.getName(),cr.getRace()});
  }
}

private void buildCursorConditionally ( MatrixCursor cursor , CharacterRecord cr , String selection , String [ ] selectionArgs ) { if ( selectionArgs == null ) cursor . addRow ( new Object [ ] { cr . getId ( ) , cr . getName ( ) , cr . getRace ( ) } ) ; else for ( String item : selectionArgs ) if ( ( selection . equals ( CharacterContract . CharacterEntry . COLUMN_NAME ) && item . equals ( cr . getName ( ) ) ) || ( selection . equals ( CharacterContract . CharacterEntry . COLUMN_RACE ) && item . equals ( cr . getRace ( ) ) ) ) { cursor . addRow ( new Object [ ] { cr . getId ( ) , cr . getName ( ) , cr . getRace ( ) } ) ; } }
build a matrixcursor that matches the parameters . this plays the role of the " concrete hook method " in the template method pattern .
