From adf41944584f67378481e84cb7661f0a39028bd8 Mon Sep 17 00:00:00 2001 From: Daniel Trebbien Date: Sun, 31 Oct 2010 12:21:05 -0700 Subject: [PATCH] Document per-implementation behaviors of native get* methods Change-Id: I5d20d7796b85ce62750dd50dd79e47d76716b24c --- core/java/android/database/CursorWindow.java | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/core/java/android/database/CursorWindow.java b/core/java/android/database/CursorWindow.java index c756825a79855..76b91f54041fb 100644 --- a/core/java/android/database/CursorWindow.java +++ b/core/java/android/database/CursorWindow.java @@ -245,6 +245,15 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { } } + /** + * Returns the value at (row, col) as a byte array. + * + *

If the value is null, then null is returned. If the + * type of column col is a string type, then the result + * is the array of bytes that make up the internal representation of the + * string value. If the type of column col is integral or floating-point, + * then an {@link SQLiteException} is thrown. + */ private native byte[] getBlob_native(int row, int col); /** @@ -332,6 +341,19 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { } } + /** + * Returns the value at (row, col) as a String. + * + *

If the value is null, then null is returned. If the + * type of column col is integral, then the result is the string + * that is obtained by formatting the integer value with the printf + * family of functions using format specifier %lld. If the + * type of column col is floating-point, then the result is the string + * that is obtained by formatting the floating-point value with the + * printf family of functions using format specifier %g. + * If the type of column col is a blob type, then an + * {@link SQLiteException} is thrown. + */ private native String getString_native(int row, int col); /** @@ -383,6 +405,17 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { } } + /** + * Returns the value at (row, col) as a long. + * + *

If the value is null, then 0L is returned. If the + * type of column col is a string type, then the result + * is the long that is obtained by parsing the string value with + * strtoll. If the type of column col is + * floating-point, then the result is the floating-point value casted to a long. + * If the type of column col is a blob type, then an + * {@link SQLiteException} is thrown. + */ private native long getLong_native(int row, int col); /** @@ -402,6 +435,17 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { } } + /** + * Returns the value at (row, col) as a double. + * + *

If the value is null, then 0.0 is returned. If the + * type of column col is a string type, then the result + * is the double that is obtained by parsing the string value with + * strtod. If the type of column col is + * integral, then the result is the integer value casted to a double. + * If the type of column col is a blob type, then an + * {@link SQLiteException} is thrown. + */ private native double getDouble_native(int row, int col); /**