|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.database.AbstractCursor
android.database.MatrixCursor
public class MatrixCursor
A mutable cursor implementation backed by an array of Objects. Use
newRow() to add rows. Automatically expands internal capacity
as needed.
| Nested Class Summary | |
|---|---|
class |
MatrixCursor.RowBuilder
Builds a row, starting from the left-most column and adding one column value at a time. |
| Nested classes/interfaces inherited from class android.database.AbstractCursor |
|---|
AbstractCursor.SelfContentObserver |
| Field Summary |
|---|
| Fields inherited from class android.database.AbstractCursor |
|---|
mClosed, mContentObservable, mContentResolver, mCurrentRowID, mDataSetObservable, mPos, mRowIdColumnIndex, mUpdatedRows |
| Constructor Summary | |
|---|---|
MatrixCursor(String[] columnNames)
Constructs a new cursor. |
|
MatrixCursor(String[] columnNames,
int initialCapacity)
Constructs a new cursor with the given initial capacity. |
|
| Method Summary | |
|---|---|
void |
addRow(Iterable<?> columnValues)
Adds a new row to the end with the given column values. |
void |
addRow(Object[] columnValues)
Adds a new row to the end with the given column values. |
String[] |
getColumnNames()
Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result. |
int |
getCount()
Returns the numbers of rows in the cursor. |
double |
getDouble(int column)
Returns the value of the requested column as a double. |
float |
getFloat(int column)
Returns the value of the requested column as a float. |
int |
getInt(int column)
Returns the value of the requested column as an int. |
long |
getLong(int column)
Returns the value of the requested column as a long. |
short |
getShort(int column)
Returns the value of the requested column as a short. |
String |
getString(int column)
Returns the value of the requested column as a String. |
boolean |
isNull(int column)
Returns true if the value in the indicated column is null. |
MatrixCursor.RowBuilder |
newRow()
Adds a new row to the end and returns a builder for that row. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MatrixCursor(String[] columnNames,
int initialCapacity)
columnNames - names of the columns, the ordering of which
determines column ordering elsewhere in this cursorinitialCapacity - in rowspublic MatrixCursor(String[] columnNames)
columnNames - names of the columns, the ordering of which
determines column ordering elsewhere in this cursor| Method Detail |
|---|
public MatrixCursor.RowBuilder newRow()
public void addRow(Object[] columnValues)
columnValues - in the same order as the the column names specified
at cursor construction time
IllegalArgumentException - if columnValues.length !=
columnNames.lengthpublic void addRow(Iterable<?> columnValues)
columnValues - in the same order as the the column names specified
at cursor construction time
IllegalArgumentException - if columnValues.size() !=
columnNames.lengthpublic int getCount()
Cursor
getCount in interface CursorgetCount in class AbstractCursorpublic String[] getColumnNames()
Cursor
getColumnNames in interface CursorgetColumnNames in class AbstractCursorpublic String getString(int column)
CursorIf the native content of that column is not text the result will be the result of passing the column value to String.valueOf(x).
getString in interface CursorgetString in class AbstractCursorcolumn - the zero-based index of the target column.
public short getShort(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Short.valueOf(x).
getShort in interface CursorgetShort in class AbstractCursorcolumn - the zero-based index of the target column.
public int getInt(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Integer.valueOf(x).
getInt in interface CursorgetInt in class AbstractCursorcolumn - the zero-based index of the target column.
public long getLong(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Long.valueOf(x).
getLong in interface CursorgetLong in class AbstractCursorcolumn - the zero-based index of the target column.
public float getFloat(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Float.valueOf(x).
getFloat in interface CursorgetFloat in class AbstractCursorcolumn - the zero-based index of the target column.
public double getDouble(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Double.valueOf(x).
getDouble in interface CursorgetDouble in class AbstractCursorcolumn - the zero-based index of the target column.
public boolean isNull(int column)
Cursortrue if the value in the indicated column is null.
isNull in interface CursorisNull in class AbstractCursorcolumn - the zero-based index of the target column.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||