private List<MurmurMessage> convertToMessages(Cursor cursor){
  List<MurmurMessage> messages=new ArrayList<>();
  cursor.moveToFirst();
  int messageIdColIndex=cursor.getColumnIndex(COL_MESSAGE_ID);
  int trustColIndex=cursor.getColumnIndex(COL_TRUST);
  int priorityColIndex=cursor.getColumnIndex(COL_LIKES);
  int messageColIndex=cursor.getColumnIndex(COL_MESSAGE);
  int pseudonymColIndex=cursor.getColumnIndex(COL_PSEUDONYM);
  int timestampColIndex=cursor.getColumnIndex(COL_TIMESTAMP);
  int latlongColIndex=cursor.getColumnIndex(COL_LATLONG);
  int timeboundColIndex=cursor.getColumnIndex(COL_EXPIRE);
  int parentColIndex=cursor.getColumnIndex(COL_PARENT);
  int bigparentColIndex=cursor.getColumnIndex(COL_BIGPARENT);
  int hopColIndex=cursor.getColumnIndex(COL_HOP);
  int hopContactsColIndex=cursor.getColumnIndex(COL_MIN_CONTACTS_FOR_HOP);
  if (cursor.getCount() > 0) {
    while (!cursor.isAfterLast()) {
      messages.add(new MurmurMessage(cursor.getString(messageIdColIndex),cursor.getString(messageColIndex),cursor.getDouble(trustColIndex),cursor.getInt(priorityColIndex),cursor.getString(pseudonymColIndex),cursor.getLong(timestampColIndex),cursor.getString(latlongColIndex),cursor.getLong(timeboundColIndex),cursor.getString(parentColIndex),cursor.getInt(hopColIndex),cursor.getString(bigparentColIndex),cursor.getInt(hopContactsColIndex)));
      cursor.moveToNext();
    }
  }
  return messages;
}

private List < MurmurMessage > convertToMessages ( Cursor cursor ) { List < MurmurMessage > messages = new ArrayList < > ( ) ; cursor . moveToFirst ( ) ; int messageIdColIndex = cursor . getColumnIndex ( COL_MESSAGE_ID ) ; int trustColIndex = cursor . getColumnIndex ( COL_TRUST ) ; int priorityColIndex = cursor . getColumnIndex ( COL_LIKES ) ; int messageColIndex = cursor . getColumnIndex ( COL_MESSAGE ) ; int pseudonymColIndex = cursor . getColumnIndex ( COL_PSEUDONYM ) ; int timestampColIndex = cursor . getColumnIndex ( COL_TIMESTAMP ) ; int latlongColIndex = cursor . getColumnIndex ( COL_LATLONG ) ; int timeboundColIndex = cursor . getColumnIndex ( COL_EXPIRE ) ; int parentColIndex = cursor . getColumnIndex ( COL_PARENT ) ; int bigparentColIndex = cursor . getColumnIndex ( COL_BIGPARENT ) ; int hopColIndex = cursor . getColumnIndex ( COL_HOP ) ; int hopContactsColIndex = cursor . getColumnIndex ( COL_MIN_CONTACTS_FOR_HOP ) ; if ( cursor . getCount ( ) > 0 ) { while ( ! cursor . isAfterLast ( ) ) { messages . add ( new MurmurMessage ( cursor . getString ( messageIdColIndex ) , cursor . getString ( messageColIndex ) , cursor . getDouble ( trustColIndex ) , cursor . getInt ( priorityColIndex ) , cursor . getString ( pseudonymColIndex ) , cursor . getLong ( timestampColIndex ) , cursor . getString ( latlongColIndex ) , cursor . getLong ( timeboundColIndex ) , cursor . getString ( parentColIndex ) , cursor . getInt ( hopColIndex ) , cursor . getString ( bigparentColIndex ) , cursor . getInt ( hopContactsColIndex ) ) ) ; cursor . moveToNext ( ) ; } } return messages ; }
convert cursor data returned from sql queries into message objects that can be returned to query supplier . this implementation does not close the supplied cursor when done
