Skip to content

Commit 715f861

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "Clarify documentation of Cursor get* methods."
2 parents c1c45a4 + 65068b0 commit 715f861

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

core/java/android/database/Cursor.java

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ public interface Cursor {
211211
/**
212212
* Returns the value of the requested column as a byte array.
213213
*
214-
* <p>If the native content of that column is not blob exception may throw
214+
* <p>The result and whether this method throws an exception when the
215+
* column value is null or the column type is not a blob type is
216+
* implementation-defined.
215217
*
216218
* @param columnIndex the zero-based index of the target column.
217219
* @return the value of that column as a byte array.
@@ -221,8 +223,9 @@ public interface Cursor {
221223
/**
222224
* Returns the value of the requested column as a String.
223225
*
224-
* <p>If the native content of that column is not text the result will be
225-
* the result of passing the column value to String.valueOf(x).
226+
* <p>The result and whether this method throws an exception when the
227+
* column value is null or the column type is not a string type is
228+
* implementation-defined.
226229
*
227230
* @param columnIndex the zero-based index of the target column.
228231
* @return the value of that column as a String.
@@ -242,8 +245,10 @@ public interface Cursor {
242245
/**
243246
* Returns the value of the requested column as a short.
244247
*
245-
* <p>If the native content of that column is not numeric the result will be
246-
* the result of passing the column value to Short.valueOf(x).
248+
* <p>The result and whether this method throws an exception when the
249+
* column value is null, the column type is not an integral type, or the
250+
* integer value is outside the range [<code>Short.MIN_VALUE</code>,
251+
* <code>Short.MAX_VALUE</code>] is implementation-defined.
247252
*
248253
* @param columnIndex the zero-based index of the target column.
249254
* @return the value of that column as a short.
@@ -253,8 +258,10 @@ public interface Cursor {
253258
/**
254259
* Returns the value of the requested column as an int.
255260
*
256-
* <p>If the native content of that column is not numeric the result will be
257-
* the result of passing the column value to Integer.valueOf(x).
261+
* <p>The result and whether this method throws an exception when the
262+
* column value is null, the column type is not an integral type, or the
263+
* integer value is outside the range [<code>Integer.MIN_VALUE</code>,
264+
* <code>Integer.MAX_VALUE</code>] is implementation-defined.
258265
*
259266
* @param columnIndex the zero-based index of the target column.
260267
* @return the value of that column as an int.
@@ -264,8 +271,10 @@ public interface Cursor {
264271
/**
265272
* Returns the value of the requested column as a long.
266273
*
267-
* <p>If the native content of that column is not numeric the result will be
268-
* the result of passing the column value to Long.valueOf(x).
274+
* <p>The result and whether this method throws an exception when the
275+
* column value is null, the column type is not an integral type, or the
276+
* integer value is outside the range [<code>Long.MIN_VALUE</code>,
277+
* <code>Long.MAX_VALUE</code>] is implementation-defined.
269278
*
270279
* @param columnIndex the zero-based index of the target column.
271280
* @return the value of that column as a long.
@@ -275,8 +284,10 @@ public interface Cursor {
275284
/**
276285
* Returns the value of the requested column as a float.
277286
*
278-
* <p>If the native content of that column is not numeric the result will be
279-
* the result of passing the column value to Float.valueOf(x).
287+
* <p>The result and whether this method throws an exception when the
288+
* column value is null, the column type is not a floating-point type, or the
289+
* floating-point value is not representable as a <code>float</code> value is
290+
* implementation-defined.
280291
*
281292
* @param columnIndex the zero-based index of the target column.
282293
* @return the value of that column as a float.
@@ -286,8 +297,10 @@ public interface Cursor {
286297
/**
287298
* Returns the value of the requested column as a double.
288299
*
289-
* <p>If the native content of that column is not numeric the result will be
290-
* the result of passing the column value to Double.valueOf(x).
300+
* <p>The result and whether this method throws an exception when the
301+
* column value is null, the column type is not a floating-point type, or the
302+
* floating-point value is not representable as a <code>double</code> value is
303+
* implementation-defined.
291304
*
292305
* @param columnIndex the zero-based index of the target column.
293306
* @return the value of that column as a double.
@@ -573,7 +586,8 @@ boolean commitUpdates(Map<? extends Long,
573586
* that are required to fetch data for the cursor.
574587
*
575588
* <p>These values may only change when requery is called.
576-
* @return cursor-defined values, or Bundle.EMTPY if there are no values. Never null.
589+
* @return cursor-defined values, or {@link android.os.Bundle#EMPTY Bundle.EMPTY} if there
590+
* are no values. Never <code>null</code>.
577591
*/
578592
Bundle getExtras();
579593

@@ -583,8 +597,10 @@ boolean commitUpdates(Map<? extends Long,
583597
*
584598
* <p>One use of this is to tell a cursor that it should retry its network request after it
585599
* reported an error.
586-
* @param extras extra values, or Bundle.EMTPY. Never null.
587-
* @return extra values, or Bundle.EMTPY. Never null.
600+
* @param extras extra values, or {@link android.os.Bundle#EMPTY Bundle.EMPTY}.
601+
* Never <code>null</code>.
602+
* @return extra values, or {@link android.os.Bundle#EMPTY Bundle.EMPTY}.
603+
* Never <code>null</code>.
588604
*/
589605
Bundle respond(Bundle extras);
590606
}

0 commit comments

Comments
 (0)