java.lang.Object | |
↳ | com.google.android.gms.common.data.DataHolder |
Class for accessing collections of data, organized into columns. This provides the backing
support for DataBuffer
. Much like a cursor, the holder supports the notion of a current
position, and has methods for extracting various types of data from named columns.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DataHolder.Builder | Helper class to build DataHolder instances containing arbitrary data. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | NULL |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a data holder with the specified data.
| |||||||||||
Creates a data holder wrapping the provided cursor, with provided status code and metadata.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get a
DataHolder.Builder to create a new DataHolder manually. | |||||||||||
Get a
DataHolder.Builder to create a new DataHolder manually. | |||||||||||
Closes the data holder, releasing all of its resources and making it completely invalid.
| |||||||||||
Copies the String content in the given column at the provided position into a
CharArrayBuffer . | |||||||||||
Retrieves the boolean value for a given column at the provided position.
| |||||||||||
Retrieves the byte array value for a given column at the provided position.
| |||||||||||
Gets the number of rows in the data holder.
| |||||||||||
Retrieves the integer value for a given column at the provided position.
| |||||||||||
Retrieves the long value for a given column at the provided position.
| |||||||||||
Retrieves the String value for a given column at the provided position.
| |||||||||||
Returns whether the given column at the provided position contains null.
| |||||||||||
Retrieves the column data at the provided position as a URI if possible, checking for null
values.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Creates a data holder with the specified data.
columns | The column names corresponding to the data in the given windows. |
---|---|
windows | The CursorWindow instances holding the data. |
statusCode | The status code of this DataHolder . |
metadata | The metadata associated with this DataHolder (may be null).
|
Creates a data holder wrapping the provided cursor, with provided status code and metadata.
cursor | The cursor containing the data. |
---|---|
statusCode | The status code of this DataHolder . |
metadata | The metadata associated with this DataHolder (may be null).
|
Get a DataHolder.Builder
to create a new DataHolder
manually.
columns | The array of column names that the object supports. |
---|---|
uniqueColumn | The non-null column name that must contain unique values. New rows added to the builder with the same value in this column will replace any older rows. |
DataHolder.Builder
object to work with.
Get a DataHolder.Builder
to create a new DataHolder
manually.
columns | The array of column names that the object supports. |
---|
DataHolder.Builder
object to work with.
Closes the data holder, releasing all of its resources and making it completely invalid.
Copies the String content in the given column at the provided position into a
CharArrayBuffer
. This will throw an IllegalArgumentException
if the column
does not exist, the position is invalid, or the data holder has been closed.
column | The column to retrieve. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |
dataOut | The CharArrayBuffer to copy into.
|
statusCode | The status code of this DataHolder . |
---|---|
metadata | The metadata associated with this DataHolder (may be null). |
DataHolder
object with the given status and null metadata.
statusCode | The status code of this DataHolder . |
---|
DataHolder
object with the given status and null metadata.
Retrieves the boolean value for a given column at the provided position. This will throw an
IllegalArgumentException
if the column does not exist, the position is invalid, or
the data holder has been closed.
column | The column to retrieve. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |
Retrieves the byte array value for a given column at the provided position. This will throw
an IllegalArgumentException
if the column does not exist, the position is invalid, or
the data holder has been closed.
column | The column to retrieve. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |
Gets the number of rows in the data holder.
Retrieves the integer value for a given column at the provided position. This will throw an
IllegalArgumentException
if the column does not exist, the position is invalid, or
the data holder has been closed.
column | The column to retrieve. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |
Retrieves the long value for a given column at the provided position. This will throw an
IllegalArgumentException
if the column does not exist, the position is invalid, or
the data holder has been closed.
column | The column to retrieve. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |
Retrieves the String value for a given column at the provided position. This will throw an
IllegalArgumentException
if the column does not exist, the position is invalid, or
the data holder has been closed.
column | The column to retrieve. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |
Returns whether the given column at the provided position contains null. This will throw an
IllegalArgumentException
if the column does not exist, the position is invalid, or
the data holder has been closed.
column | The column to check. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |
Retrieves the column data at the provided position as a URI if possible, checking for null
values. This will throw an IllegalArgumentException
if the column does not exist, the
position is invalid, or the data holder has been closed.
column | The column to retrieve. |
---|---|
row | The row to retrieve the data from. |
windowIndex | Index of the cursor window to extract the data from. |