public class MatrixCursor extends AbstractCursor
Object
s. 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.SelfContentObserver
mClosed, mContentResolver, mCurrentRowID, mPos, mRowIdColumnIndex, mUpdatedRows
FIELD_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, updateToNull
public 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.length
public 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.length
public int getCount()
getCount
in class AbstractCursor
public java.lang.String[] getColumnNames()
getColumnNames
in class AbstractCursor
public java.lang.String getString(int column)
getString
in class AbstractCursor
public short getShort(int column)
getShort
in class AbstractCursor
public int getInt(int column)
getInt
in class AbstractCursor
public long getLong(int column)
getLong
in class AbstractCursor
public float getFloat(int column)
getFloat
in class AbstractCursor
public double getDouble(int column)
getDouble
in class AbstractCursor
public int getType(int column)
Cursor
#getInt(int)
, #getFloat(int)
etc.
Returned column types are
getType
in interface Cursor
getType
in class AbstractCursor
column
- the zero-based index of the target column.public boolean isNull(int column)
isNull
in class AbstractCursor