Searched refs:cursor (Results 1 - 25 of 98) sorted by relevance

1234

/frameworks/base/core/tests/coretests/src/android/database/
H A DMatrixCursorTest.java28 Cursor cursor = new MatrixCursor(new String[] { "a" });
29 assertEquals(0, cursor.getCount());
33 MatrixCursor cursor = new MatrixCursor(new String[] { "a" });
34 cursor.newRow().add(null);
35 cursor.moveToNext();
36 assertTrue(cursor.isNull(0));
37 assertNull(cursor.getString(0));
38 assertNull(cursor.getBlob(0));
39 assertEquals(0, cursor.getShort(0));
40 assertEquals(0, cursor
150 checkValues(MatrixCursor cursor) argument
[all...]
/frameworks/ex/common/java/com/android/common/io/
H A DMoreCloseables.java26 * Closes the supplied cursor iff it is not null.
28 public static void closeQuietly(Cursor cursor) { argument
29 if (cursor != null) {
30 cursor.close();
/frameworks/base/core/java/android/widget/
H A DCursorTreeAdapter.java44 /** The cursor helper that is used to get the groups */
48 * The map of a group position to the group's children cursor helper (the
49 * cursor helper that is used to get the children for that group)
58 * Constructor. The adapter will call {@link Cursor#requery()} on the cursor whenever
61 * @param cursor The cursor from which to get the data for the groups.
63 public CursorTreeAdapter(Cursor cursor, Context context) { argument
64 init(cursor, context, true);
70 * @param cursor The cursor fro
76 CursorTreeAdapter(Cursor cursor, Context context, boolean autoRequery) argument
80 init(Cursor cursor, Context context, boolean autoRequery) argument
139 setGroupCursor(Cursor cursor) argument
221 newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent) argument
233 bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) argument
265 newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent) argument
277 bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) argument
343 convertToString(Cursor cursor) argument
382 changeCursor(Cursor cursor) argument
408 MyCursorHelper(Cursor cursor) argument
453 changeCursor(Cursor cursor, boolean releaseCursors) argument
[all...]
H A DResourceCursorTreeAdapter.java41 * @param cursor The database cursor
51 public ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
53 super(cursor, context);
68 * @param cursor The database cursor
76 public ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
78 this(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout, childLayout);
86 * @param cursor The database cursor
92 ResourceCursorTreeAdapter(Context context, Cursor cursor, int groupLayout, int childLayout) argument
98 newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent) argument
104 newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent) argument
[all...]
H A DSimpleCursorTreeAdapter.java25 * An easy adapter to map columns from a cursor to TextViews or ImageViews
75 * @param cursor The database cursor
102 public SimpleCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
105 super(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout,
116 * @param cursor The database cursor
139 public SimpleCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
142 super(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout);
152 * @param cursor Th
172 SimpleCursorTreeAdapter(Context context, Cursor cursor, int groupLayout, String[] groupFrom, int[] groupTo, int childLayout, String[] childFrom, int[] childTo) argument
212 bindView(View view, Context context, Cursor cursor, int[] from, int[] to) argument
241 initFromColumns(Cursor cursor, String[] fromColumnNames, int[] fromColumns) argument
248 bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) argument
258 bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) argument
324 setViewValue(View view, Cursor cursor, int columnIndex) argument
[all...]
H A DCursorFilter.java32 CharSequence convertToString(Cursor cursor); argument
35 void changeCursor(Cursor cursor); argument
49 Cursor cursor = mClient.runQueryOnBackgroundThread(constraint);
52 if (cursor != null) {
53 results.count = cursor.getCount();
54 results.values = cursor;
H A DAlphabetIndexer.java28 * invalidates the cache if changes occur in the cursor.
30 * Your adapter is responsible for updating the cursor by calling {@link #setCursor} if the
31 * cursor changes. {@link #getPositionForSection} method does the binary search for the starting
42 * The index of the cursor column that this list is sorted on.
58 * the dataset changes or the cursor changes.
74 * @param cursor the cursor containing the data set
75 * @param sortedColumnIndex the column number in the cursor that is sorted
82 public AlphabetIndexer(Cursor cursor, int sortedColumnIndex, CharSequence alphabet) { argument
83 mDataCursor = cursor;
112 setCursor(Cursor cursor) argument
[all...]
/frameworks/ex/common/java/com/android/common/widget/
H A DCompositeCursorAdapter.java36 Cursor cursor; field in class:CompositeCursorAdapter.Partition
79 * Registers a partition. The cursor for that partition can be set later.
100 Cursor cursor = mPartitions[partitionIndex].cursor;
101 if (cursor != null && !cursor.isClosed()) {
102 cursor.close();
117 mPartitions[i].cursor = null;
128 Cursor cursor = mPartitions[i].cursor;
210 changeCursor(int partition, Cursor cursor) argument
358 getHeaderView(int partition, Cursor cursor, View convertView, ViewGroup parent) argument
370 newHeaderView(Context context, int partition, Cursor cursor, ViewGroup parent) argument
378 bindHeaderView(View view, int partition, Cursor cursor) argument
384 getView(int partition, Cursor cursor, int position, View convertView, ViewGroup parent) argument
400 newView(Context context, int partition, Cursor cursor, int position, ViewGroup parent) argument
407 bindView(View v, int partition, Cursor cursor, int position) argument
[all...]
/frameworks/base/core/java/android/provider/
H A DCalendarContract.java453 * Creates an entity iterator for the given cursor. It assumes the
454 * cursor contains a calendars query.
456 * @param cursor query on {@link #CONTENT_URI}
459 public static EntityIterator newEntityIterator(Cursor cursor) { argument
460 return new EntityIteratorImpl(cursor);
465 public EntityIteratorImpl(Cursor cursor) { argument
466 super(cursor);
470 public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException { argument
471 // we expect the cursor is already at the row we need to read from
472 final long calendarId = cursor
1179 newEntityIterator(Cursor cursor, ContentResolver resolver) argument
1191 newEntityIterator(Cursor cursor, ContentProviderClient provider) argument
1230 EntityIteratorImpl(Cursor cursor, ContentResolver resolver) argument
1236 EntityIteratorImpl(Cursor cursor, ContentProviderClient provider) argument
1243 getEntityAndIncrementCursor(Cursor cursor) argument
[all...]
/frameworks/base/core/java/android/content/
H A DCursorEntityIterator.java23 * Abstract implementation of EntityIterator that makes it easy to wrap a cursor
32 * Constructor that makes initializes the cursor such that the iterator points to the
34 * @param cursor the cursor that contains the rows that make up the entities
36 public CursorEntityIterator(Cursor cursor) { argument
38 mCursor = cursor;
43 * Returns the entity that the cursor is currently pointing to. This must take care to advance
44 * the cursor past this entity. This will never be called if the cursor is at the end.
45 * @param cursor th
49 getEntityAndIncrementCursor(Cursor cursor) argument
[all...]
H A DCursorLoader.java31 * querying cursors, building on {@link AsyncTaskLoader} to perform the cursor
56 Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection,
58 if (cursor != null) {
59 // Ensure the cursor window is filled
60 cursor.getCount();
61 registerContentObserver(cursor, mObserver);
63 return cursor;
68 * when the cursor needs to be refreshed.
70 void registerContentObserver(Cursor cursor, ContentObserver observer) { argument
71 cursor
76 deliverResult(Cursor cursor) argument
150 onCanceled(Cursor cursor) argument
[all...]
H A DContentQueryMap.java28 * Caches the contents of a cursor into a Map of String->ContentValues and optionally
29 * keeps the cache fresh by registering for updates on the content backing the cursor. The column of
33 * The cursor data is accessed by row key and column name via getValue().
47 /** Set when a cursor change notification is received and is cleared on a call to requery(). */
51 * Creates a ContentQueryMap that caches the content backing the cursor
53 * @param cursor the cursor whose contents should be cached
55 * @param keepUpdated true if the cursor's ContentProvider should be monitored for changes and
62 public ContentQueryMap(Cursor cursor, String columnNameOfKey, boolean keepUpdated, argument
64 mCursor = cursor;
148 readCursorIntoCache(Cursor cursor) argument
[all...]
/frameworks/base/tests/LocationTracker/src/com/android/locationtracker/data/
H A DTrackerDataHelper.java111 Cursor cursor = mContext.getContentResolver().query(
114 if (cursor == null) {
115 return cursor;
117 int pos = (cursor.getCount() < limit ? 0 : cursor.getCount() - limit);
118 cursor.moveToPosition(pos);
119 return cursor;
123 * Retrieves a cursor that starts at the last limit rows
126 * @return a cursor, null if bad things happened
158 * Helper method which converts row referenced by given cursor t
165 getNextOutput(Cursor cursor) argument
[all...]
H A DTrackerEntry.java208 static TrackerEntry createEntry(Cursor cursor) { argument
209 String timestamp = cursor.getString(cursor.getColumnIndex(TIMESTAMP));
210 String tag = cursor.getString(cursor.getColumnIndex(TAG));
211 String sType = cursor.getString(cursor.getColumnIndex(ENTRY_TYPE));
216 location.setLatitude(cursor.getFloat(cursor
218 location.setLongitude(cursor
245 getNullableFloat(Cursor cursor, String colName) argument
[all...]
H A DTrackerListHelper.java50 Cursor cursor = mActivity.managedQuery(TrackerProvider.CONTENT_URI,
53 TrackerAdapter adapter = new TrackerAdapter(mActivity, layout, cursor);
55 cursor.setNotificationUri(mActivity.getContentResolver(),
67 public void bindView(View view, Context context, Cursor cursor) { argument
71 .createEntry(cursor));
/frameworks/support/v4/java/android/support/v4/content/
H A DCursorLoader.java49 Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection,
51 if (cursor != null) {
52 // Ensure the cursor window is filled
53 cursor.getCount();
54 registerContentObserver(cursor, mObserver);
56 return cursor;
61 * when the cursor needs to be refreshed.
63 void registerContentObserver(Cursor cursor, ContentObserver observer) { argument
64 cursor.registerContentObserver(mObserver);
69 public void deliverResult(Cursor cursor) { argument
143 onCanceled(Cursor cursor) argument
[all...]
/frameworks/base/core/java/android/webkit/
H A DWebViewDatabase.java504 Cursor cursor = null;
507 cursor = mDatabase.query(mTableNames[tableId], ID_PROJECTION,
509 ret = cursor.moveToFirst() == true;
513 if (cursor != null) cursor.close();
542 Cursor cursor = null;
544 cursor = mDatabase.query(mTableNames[TABLE_COOKIES_ID],
547 if (cursor.moveToFirst()) {
548 int domainCol = cursor.getColumnIndex(COOKIES_DOMAIN_COL);
549 int pathCol = cursor
[all...]
/frameworks/support/v4/java/android/support/v4/widget/
H A DCursorFilter.java33 CharSequence convertToString(Cursor cursor); argument
36 void changeCursor(Cursor cursor); argument
50 Cursor cursor = mClient.runQueryOnBackgroundThread(constraint);
53 if (cursor != null) {
54 results.count = cursor.getCount();
55 results.values = cursor;
/frameworks/compile/linkloader/utils/
H A Dserialize.h63 unsigned char const *cursor; member in class:ArchiveReader
71 cursor(buf), cursor_base(NULL), good(buf != NULL) {
76 cursor_base = cursor;
81 rsl_assert(cursor_base + size >= cursor);
82 cursor = cursor_base + size;
88 cursor = buf_begin + off;
90 cursor += off;
95 if (!good || cursor + size > buf_end) {
98 memcpy(array, cursor, size);
138 size_t delta = static_cast<size_t>(cursor
[all...]
/frameworks/base/core/java/android/database/
H A DDatabaseUtils.java250 * Fills the specified cursor window by iterating over the contents of the cursor.
251 * The window is filled until the cursor is exhausted or the window runs out
254 * The original position of the cursor is left unchanged by this operation.
256 * @param cursor The cursor that contains the data to put in the window.
261 public static void cursorFillWindow(final Cursor cursor, argument
263 if (position < 0 || position >= cursor.getCount()) {
268 final int oldPos = cursor.getPosition();
269 final int numColumns = cursor
452 dumpCursor(Cursor cursor) argument
463 dumpCursor(Cursor cursor, PrintStream stream) argument
484 dumpCursor(Cursor cursor, StringBuilder sb) argument
505 dumpCursorToString(Cursor cursor) argument
516 dumpCurrentRow(Cursor cursor) argument
526 dumpCurrentRow(Cursor cursor, PrintStream stream) argument
550 dumpCurrentRow(Cursor cursor, StringBuilder sb) argument
574 dumpCurrentRowToString(Cursor cursor) argument
587 cursorStringToContentValues(Cursor cursor, String field, ContentValues values) argument
600 cursorStringToInsertHelper(Cursor cursor, String field, InsertHelper inserter, int index) argument
613 cursorStringToContentValues(Cursor cursor, String field, ContentValues values, String key) argument
625 cursorIntToContentValues(Cursor cursor, String field, ContentValues values) argument
637 cursorIntToContentValues(Cursor cursor, String field, ContentValues values, String key) argument
654 cursorLongToContentValues(Cursor cursor, String field, ContentValues values) argument
667 cursorLongToContentValues(Cursor cursor, String field, ContentValues values, String key) argument
685 cursorDoubleToCursorValues(Cursor cursor, String field, ContentValues values) argument
698 cursorDoubleToContentValues(Cursor cursor, String field, ContentValues values, String key) argument
714 cursorRowToContentValues(Cursor cursor, ContentValues values) argument
852 cursorStringToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) argument
868 cursorLongToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) argument
884 cursorShortToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) argument
900 cursorIntToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) argument
916 cursorFloatToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) argument
932 cursorDoubleToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) argument
[all...]
/frameworks/base/core/tests/coretests/src/android/app/
H A DDownloadManagerFunctionalTest.java83 Cursor cursor = getCursor(dlRequest);
85 verifyInt(cursor, DownloadManager.COLUMN_REASON, error);
87 cursor.close();
130 Cursor cursor = mDownloadManager.query(new Query().setFilterById(requestId));
132 assertEquals(1, cursor.getCount());
133 assertTrue(cursor.moveToFirst());
139 int colIndex = cursor.getColumnIndex(DownloadManager.COLUMN_LOCAL_FILENAME);
140 String fileName = cursor.getString(colIndex);
144 cursor.close();
170 Cursor cursor
[all...]
H A DSuggestionProvider.java69 MatrixCursor cursor = new MatrixCursor(COLUMNS);
72 addRow(cursor, query + suffix);
74 return cursor;
80 private void addRow(MatrixCursor cursor, String string) { argument
81 long id = cursor.getCount();
82 cursor.newRow().add(id).add(string).add(Intent.ACTION_SEARCH).add(string);
H A DDownloadManagerBaseTest.java148 Cursor cursor = dm.query(new Query().setFilterById(id));
150 if (cursor.moveToFirst()) {
151 int status = cursor.getInt(cursor.getColumnIndex(
158 cursor.close();
455 protected void logDBColumnData(Cursor cursor, String column) { argument
456 int index = cursor.getColumnIndex(column);
458 Log.i(LOG_TAG, "columnValue: " + cursor.getString(index));
489 Cursor cursor = mDownloadManager.query(new Query().setFilterById(requestId));
492 assertEquals(1, cursor
975 verifyInt(Cursor cursor, String columnName, int expected) argument
988 verifyString(Cursor cursor, String columnName, String expected) argument
[all...]
/frameworks/ex/common/java/com/android/common/contacts/
H A DDataUsageStatUpdater.java120 final Cursor cursor = mResolver.query(Email.CONTENT_URI,
124 if (cursor == null) {
127 final Set<Long> contactIds = new HashSet<Long>(cursor.getCount());
128 final Set<Long> dataIds = new HashSet<Long>(cursor.getCount());
130 cursor.move(-1);
131 while(cursor.moveToNext()) {
132 contactIds.add(cursor.getLong(0));
133 dataIds.add(cursor.getLong(1));
136 cursor.close();
170 final Cursor cursor
[all...]
H A DBaseEmailAddressAdapter.java174 Cursor cursor = null;
185 cursor = mContentResolver.query(uri, EmailQuery.PROJECTION, null, null, null);
186 results.count = cursor.getCount();
188 results.values = new Cursor[] { directoryCursor, cursor };
238 Cursor cursor = mContentResolver.query(
240 results.values = cursor;
247 Cursor cursor = (Cursor) results.values;
248 onPartitionLoadFinished(constraint, mPartitionIndex, cursor);
314 protected View newView(Context context, int partitionIndex, Cursor cursor, argument
325 protected void bindView(View v, int partition, Cursor cursor, in argument
500 onPartitionLoadFinished( CharSequence constraint, int partitionIndex, Cursor cursor) argument
528 removeDuplicatesAndTruncate(int partition, Cursor cursor) argument
554 hasDuplicates(Cursor cursor, int partition) argument
589 makeDisplayString(Cursor cursor) argument
[all...]

Completed in 314 milliseconds

1234