Skip to content

Commit adf4194

Browse files
dtrebbienJean-Baptiste Queru
authored andcommitted
Document per-implementation behaviors of native get* methods
Change-Id: I5d20d7796b85ce62750dd50dd79e47d76716b24c
1 parent 65068b0 commit adf4194

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

core/java/android/database/CursorWindow.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,15 @@ public byte[] getBlob(int row, int col) {
245245
}
246246
}
247247

248+
/**
249+
* Returns the value at (<code>row</code>, <code>col</code>) as a <code>byte</code> array.
250+
*
251+
* <p>If the value is null, then <code>null</code> is returned. If the
252+
* type of column <code>col</code> is a string type, then the result
253+
* is the array of bytes that make up the internal representation of the
254+
* string value. If the type of column <code>col</code> is integral or floating-point,
255+
* then an {@link SQLiteException} is thrown.
256+
*/
248257
private native byte[] getBlob_native(int row, int col);
249258

250259
/**
@@ -332,6 +341,19 @@ public String getString(int row, int col) {
332341
}
333342
}
334343

344+
/**
345+
* Returns the value at (<code>row</code>, <code>col</code>) as a <code>String</code>.
346+
*
347+
* <p>If the value is null, then <code>null</code> is returned. If the
348+
* type of column <code>col</code> is integral, then the result is the string
349+
* that is obtained by formatting the integer value with the <code>printf</code>
350+
* family of functions using format specifier <code>%lld</code>. If the
351+
* type of column <code>col</code> is floating-point, then the result is the string
352+
* that is obtained by formatting the floating-point value with the
353+
* <code>printf</code> family of functions using format specifier <code>%g</code>.
354+
* If the type of column <code>col</code> is a blob type, then an
355+
* {@link SQLiteException} is thrown.
356+
*/
335357
private native String getString_native(int row, int col);
336358

337359
/**
@@ -383,6 +405,17 @@ public long getLong(int row, int col) {
383405
}
384406
}
385407

408+
/**
409+
* Returns the value at (<code>row</code>, <code>col</code>) as a <code>long</code>.
410+
*
411+
* <p>If the value is null, then <code>0L</code> is returned. If the
412+
* type of column <code>col</code> is a string type, then the result
413+
* is the <code>long</code> that is obtained by parsing the string value with
414+
* <code>strtoll</code>. If the type of column <code>col</code> is
415+
* floating-point, then the result is the floating-point value casted to a <code>long</code>.
416+
* If the type of column <code>col</code> is a blob type, then an
417+
* {@link SQLiteException} is thrown.
418+
*/
386419
private native long getLong_native(int row, int col);
387420

388421
/**
@@ -402,6 +435,17 @@ public double getDouble(int row, int col) {
402435
}
403436
}
404437

438+
/**
439+
* Returns the value at (<code>row</code>, <code>col</code>) as a <code>double</code>.
440+
*
441+
* <p>If the value is null, then <code>0.0</code> is returned. If the
442+
* type of column <code>col</code> is a string type, then the result
443+
* is the <code>double</code> that is obtained by parsing the string value with
444+
* <code>strtod</code>. If the type of column <code>col</code> is
445+
* integral, then the result is the integer value casted to a <code>double</code>.
446+
* If the type of column <code>col</code> is a blob type, then an
447+
* {@link SQLiteException} is thrown.
448+
*/
405449
private native double getDouble_native(int row, int col);
406450

407451
/**

0 commit comments

Comments
 (0)