Methods Summary |
---|
public boolean | allocRow()Allocate a row in cursor window
acquireReference();
try {
return allocRow_native();
} finally {
releaseReference();
}
|
private native boolean | allocRow_native()
|
public void | clear()Clears out the existing contents of the window, making it safe to reuse
for new data. Note that the number of columns in the window may NOT
change across a call to clear().
acquireReference();
try {
mStartPos = 0;
native_clear();
} finally {
releaseReference();
}
|
public void | close()Cleans up the native resources associated with the window.
releaseReference();
|
private native void | close_native()
|
public void | copyStringToBuffer(int row, int col, CharArrayBuffer buffer)copy the text for the given field in the provided char array.
if (buffer == null) {
throw new IllegalArgumentException("CharArrayBuffer should not be null");
}
if (buffer.data == null) {
buffer.data = new char[64];
}
acquireReference();
try {
char[] newbuf = copyStringToBuffer_native(
row - mStartPos, col, buffer.data.length, buffer);
if (newbuf != null) {
buffer.data = newbuf;
}
} finally {
releaseReference();
}
|
private native char[] | copyStringToBuffer_native(int row, int col, int bufferSize, CharArrayBuffer buffer)
|
public int | describeContents()
return 0;
|
protected void | finalize()
// Just in case someone forgot to call close...
close_native();
|
public void | freeLastRow()Free the last row
acquireReference();
try {
freeLastRow_native();
} finally {
releaseReference();
}
|
private native void | freeLastRow_native()
|
public byte[] | getBlob(int row, int col)Returns a byte array for the given field.
acquireReference();
try {
return getBlob_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
private native byte[] | getBlob_native(int row, int col)
|
public double | getDouble(int row, int col)Returns a double for the given field.
row is 0 based
acquireReference();
try {
return getDouble_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
private native double | getDouble_native(int row, int col)
|
public float | getFloat(int row, int col)Returns a float for the given field.
row is 0 based
acquireReference();
try {
return (float) getDouble_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
public int | getInt(int row, int col)Returns an int for the given field.
acquireReference();
try {
return (int) getLong_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
public long | getLong(int row, int col)Returns a long for the given field.
row is 0 based
acquireReference();
try {
return getLong_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
private native long | getLong_native(int row, int col)
|
public int | getNumRows()Returns the number of rows in this window.
acquireReference();
try {
return getNumRows_native();
} finally {
releaseReference();
}
|
private native int | getNumRows_native()
|
public short | getShort(int row, int col)Returns a short for the given field.
row is 0 based
acquireReference();
try {
return (short) getLong_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
public int | getStartPosition()Returns the starting position of this window within the entire
Cursor's result set.
return mStartPos;
|
public java.lang.String | getString(int row, int col)Returns a String for the given field.
acquireReference();
try {
return getString_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
private native java.lang.String | getString_native(int row, int col)
|
public boolean | isBlob(int row, int col)Checks if a field contains either a blob or is null.
acquireReference();
try {
return isBlob_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
private native boolean | isBlob_native(int row, int col)
|
public boolean | isNull(int row, int col)Returns {@code true} if given field is {@code NULL}.
acquireReference();
try {
return isNull_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
private native boolean | isNull_native(int row, int col)
|
private native void | native_clear()Clears out the native side of things
|
private native android.os.IBinder | native_getBinder()Get the binder for the native side of the window
|
private native void | native_init(boolean localOnly)Does the native side initialization for an empty window
|
private native void | native_init(android.os.IBinder nativeBinder)Does the native side initialization with an existing binder from another process
|
public static android.database.CursorWindow | newFromParcel(android.os.Parcel p)
return CREATOR.createFromParcel(p);
|
protected void | onAllReferencesReleased()
close_native();
|
public boolean | putBlob(byte[] value, int row, int col)copy byte array to cursor window
acquireReference();
try {
return putBlob_native(value, row - mStartPos, col);
} finally {
releaseReference();
}
|
private native boolean | putBlob_native(byte[] value, int row, int col)
|
public boolean | putDouble(double value, int row, int col)Copy double to cursor window
acquireReference();
try {
return putDouble_native(value, row - mStartPos, col);
} finally {
releaseReference();
}
|
private native boolean | putDouble_native(double value, int row, int col)
|
public boolean | putLong(long value, int row, int col)Copy integer to cursor window
acquireReference();
try {
return putLong_native(value, row - mStartPos, col);
} finally {
releaseReference();
}
|
private native boolean | putLong_native(long value, int row, int col)
|
public boolean | putNull(int row, int col)Set the [row, col] value to NULL
acquireReference();
try {
return putNull_native(row - mStartPos, col);
} finally {
releaseReference();
}
|
private native boolean | putNull_native(int row, int col)
|
public boolean | putString(java.lang.String value, int row, int col)Copy String to cursor window
acquireReference();
try {
return putString_native(value, row - mStartPos, col);
} finally {
releaseReference();
}
|
private native boolean | putString_native(java.lang.String value, int row, int col)
|
public boolean | setNumColumns(int columnNum)Set number of Columns
acquireReference();
try {
return setNumColumns_native(columnNum);
} finally {
releaseReference();
}
|
private native boolean | setNumColumns_native(int columnNum)
|
public void | setStartPosition(int pos)Set the start position of cursor window
mStartPos = pos;
|
public void | writeToParcel(android.os.Parcel dest, int flags)
dest.writeStrongBinder(native_getBinder());
dest.writeInt(mStartPos);
|