@SuppressWarnings("unchecked") protected <T>T mathQuery(String tableName,String[] columns,String[] conditions,Class<T> type){
  BaseUtility.checkConditionsCorrect(conditions);
  Cursor cursor=null;
  T result=null;
  try {
    cursor=mDatabase.query(tableName,columns,getWhereClause(conditions),getWhereArgs(conditions),null,null,null);
    if (cursor.moveToFirst()) {
      Class<?> cursorClass=cursor.getClass();
      Method method=cursorClass.getMethod(genGetColumnMethod(type),int.class);
      result=(T)method.invoke(cursor,0);
    }
  }
 catch (  Exception e) {
    throw new DataSupportException(e.getMessage());
  }
 finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return result;
}

@ SuppressWarnings ( "unchecked" ) protected < T > T mathQuery ( String tableName , String [ ] columns , String [ ] conditions , Class < T > type ) { BaseUtility . checkConditionsCorrect ( conditions ) ; Cursor cursor = null ; T result = null ; try { cursor = mDatabase . query ( tableName , columns , getWhereClause ( conditions ) , getWhereArgs ( conditions ) , null , null , null ) ; if ( cursor . moveToFirst ( ) ) { Class < ? > cursorClass = cursor . getClass ( ) ; Method method = cursorClass . getMethod ( genGetColumnMethod ( type ) , int . class ) ; result = ( T ) method . invoke ( cursor , 0 ) ; } } catch ( Exception e ) { throw new DataSupportException ( e . getMessage ( ) ) ; } finally { if ( cursor != null ) { cursor . close ( ) ; } } return result ; }
handles the math query of the given table .
