Code example for HashMap

Methods: keySet, size

0
        } 
        return ret;
    } 
 
    private Sample queryLastSample() { 
        String[] columns = mColumnMap.keySet().toArray(
                new String[mColumnMap.size()]);
 
        Cursor cursor = query(null, null, columns, null, null, COLUMN_TIMESTAMP
                + " DESC LIMIT 1"); 
 
        if (cursor == null) {
            // There are no results 
            return null; 
        } else { 
            cursor.moveToFirst();
            if (!cursor.isAfterLast()) {
                Sample s = fillSample(cursor);
                cursor.close();
                lastSample = s;
                return s;