public class MatrixCursor extends AbstractCursor
Objects. Use
newRow() to add rows. Automatically expands internal capacity
as needed.| Modifier and Type | Class and Description |
|---|---|
class |
MatrixCursor.RowBuilder
Builds a row, starting from the left-most column and adding one column
value at a time.
|
AbstractCursor.SelfContentObservermClosed, mContentResolver, mCurrentRowID, mPos, mRowIdColumnIndex, mUpdatedRowsFIELD_TYPE_BLOB, FIELD_TYPE_FLOAT, FIELD_TYPE_INTEGER, FIELD_TYPE_NULL, FIELD_TYPE_STRING| Constructor and Description |
|---|
MatrixCursor(java.lang.String[] columnNames)
Constructs a new cursor.
|
MatrixCursor(java.lang.String[] columnNames,
int initialCapacity)
Constructs a new cursor with the given initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(java.lang.Iterable<?> columnValues)
Adds a new row to the end with the given column values.
|
void |
addRow(java.lang.Object[] columnValues)
Adds a new row to the end with the given column values.
|
java.lang.String[] |
getColumnNames() |
int |
getCount() |
double |
getDouble(int column) |
float |
getFloat(int column) |
int |
getInt(int column) |
long |
getLong(int column) |
short |
getShort(int column) |
java.lang.String |
getString(int column) |
int |
getType(int column)
Returns data type of the given column's value.
|
boolean |
isNull(int column) |
MatrixCursor.RowBuilder |
newRow()
Adds a new row to the end and returns a builder for that row.
|
abortUpdates, checkPosition, close, commitUpdates, commitUpdates, copyStringToBuffer, deactivate, deactivateInternal, deleteRow, fillWindow, finalize, getBlob, getColumnCount, getColumnIndex, getColumnIndexOrThrow, getColumnName, getDataSetObservable, getExtras, getNotificationUri, getPosition, getUpdatedField, getWantsAllOnMoveCalls, getWindow, hasUpdates, isAfterLast, isBeforeFirst, isClosed, isFieldUpdated, isFirst, isLast, move, moveToFirst, moveToLast, moveToNext, moveToPosition, moveToPrevious, notifyDataSetChange, onChange, onMove, registerContentObserver, registerDataSetObserver, requery, respond, setNotificationUri, supportsUpdates, unregisterContentObserver, unregisterDataSetObserver, update, updateBlob, updateDouble, updateFloat, updateInt, updateLong, updateShort, updateString, updateToNullpublic MatrixCursor(java.lang.String[] columnNames,
int initialCapacity)
columnNames - names of the columns, the ordering of which
determines column ordering elsewhere in this cursorinitialCapacity - in rowspublic MatrixCursor(java.lang.String[] columnNames)
columnNames - names of the columns, the ordering of which
determines column ordering elsewhere in this cursorpublic MatrixCursor.RowBuilder newRow()
public void addRow(java.lang.Object[] columnValues)
columnValues - in the same order as the the column names specified
at cursor construction timejava.lang.IllegalArgumentException - if columnValues.length !=
columnNames.lengthpublic void addRow(java.lang.Iterable<?> columnValues)
columnValues - in the same order as the the column names specified
at cursor construction timejava.lang.IllegalArgumentException - if columnValues.size() !=
columnNames.lengthpublic int getCount()
getCount in class AbstractCursorpublic java.lang.String[] getColumnNames()
getColumnNames in class AbstractCursorpublic java.lang.String getString(int column)
getString in class AbstractCursorpublic short getShort(int column)
getShort in class AbstractCursorpublic int getInt(int column)
getInt in class AbstractCursorpublic long getLong(int column)
getLong in class AbstractCursorpublic float getFloat(int column)
getFloat in class AbstractCursorpublic double getDouble(int column)
getDouble in class AbstractCursorpublic int getType(int column)
Cursor#getInt(int), #getFloat(int)
etc.
Returned column types are
getType in interface CursorgetType in class AbstractCursorcolumn - the zero-based index of the target column.public boolean isNull(int column)
isNull in class AbstractCursor