IT. Expert System.

Android Reference

AbstractWindowedCursor


android.database

Class AbstractWindowedCursor

  • All Implemented Interfaces:
    CrossProcessCursor, Cursor, Closeable, AutoCloseable
    Direct Known Subclasses:
    BulkCursorToCursorAdaptor, SQLiteCursor


    public abstract class AbstractWindowedCursor
    extends AbstractCursor
    A base class for Cursors that store their data in CursorWindows.

    The cursor owns the cursor window it uses. When the cursor is closed, its window is also closed. Likewise, when the window used by the cursor is changed, its old window is closed. This policy of strict ownership ensures that cursor windows are not leaked.

    Subclasses are responsible for filling the cursor window with data during AbstractCursor.onMove(int, int), allocating a new cursor window if necessary. During AbstractCursor.requery(), the existing cursor window should be cleared and filled with new data.

    If the contents of the cursor change or become invalid, the old window must be closed (because it is owned by the cursor) and set to null.

    • Field Detail

      • mWindow

        protected CursorWindow mWindow
        The cursor window owned by this cursor.
    • Constructor Detail

      • AbstractWindowedCursor

        public AbstractWindowedCursor()
    • Method Detail

      • getBlob

        public byte[] getBlob(int columnIndex)
        Description copied from interface: Cursor
        Returns the value of the requested column as a byte array.

        The result and whether this method throws an exception when the column value is null or the column type is not a blob type is implementation-defined.

        Specified by:
        getBlob in interface Cursor
        Overrides:
        getBlob in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        the value of that column as a byte array.
      • getString

        public String getString(int columnIndex)
        Description copied from interface: Cursor
        Returns the value of the requested column as a String.

        The result and whether this method throws an exception when the column value is null or the column type is not a string type is implementation-defined.

        Specified by:
        getString in interface Cursor
        Specified by:
        getString in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        the value of that column as a String.
      • copyStringToBuffer

        public void copyStringToBuffer(int columnIndex,
                              CharArrayBuffer buffer)
        Description copied from interface: Cursor
        Retrieves the requested column text and stores it in the buffer provided. If the buffer size is not sufficient, a new char buffer will be allocated and assigned to CharArrayBuffer.data
        Specified by:
        copyStringToBuffer in interface Cursor
        Overrides:
        copyStringToBuffer in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column. if the target column is null, return buffer
        buffer - the buffer to copy the text into.
      • getShort

        public short getShort(int columnIndex)
        Description copied from interface: Cursor
        Returns the value of the requested column as a short.

        The result and whether this method throws an exception when the column value is null, the column type is not an integral type, or the integer value is outside the range [Short.MIN_VALUE, Short.MAX_VALUE] is implementation-defined.

        Specified by:
        getShort in interface Cursor
        Specified by:
        getShort in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        the value of that column as a short.
      • getInt

        public int getInt(int columnIndex)
        Description copied from interface: Cursor
        Returns the value of the requested column as an int.

        The result and whether this method throws an exception when the column value is null, the column type is not an integral type, or the integer value is outside the range [Integer.MIN_VALUE, Integer.MAX_VALUE] is implementation-defined.

        Specified by:
        getInt in interface Cursor
        Specified by:
        getInt in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        the value of that column as an int.
      • getLong

        public long getLong(int columnIndex)
        Description copied from interface: Cursor
        Returns the value of the requested column as a long.

        The result and whether this method throws an exception when the column value is null, the column type is not an integral type, or the integer value is outside the range [Long.MIN_VALUE, Long.MAX_VALUE] is implementation-defined.

        Specified by:
        getLong in interface Cursor
        Specified by:
        getLong in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        the value of that column as a long.
      • getFloat

        public float getFloat(int columnIndex)
        Description copied from interface: Cursor
        Returns the value of the requested column as a float.

        The result and whether this method throws an exception when the column value is null, the column type is not a floating-point type, or the floating-point value is not representable as a float value is implementation-defined.

        Specified by:
        getFloat in interface Cursor
        Specified by:
        getFloat in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        the value of that column as a float.
      • getDouble

        public double getDouble(int columnIndex)
        Description copied from interface: Cursor
        Returns the value of the requested column as a double.

        The result and whether this method throws an exception when the column value is null, the column type is not a floating-point type, or the floating-point value is not representable as a double value is implementation-defined.

        Specified by:
        getDouble in interface Cursor
        Specified by:
        getDouble in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        the value of that column as a double.
      • isNull

        public boolean isNull(int columnIndex)
        Description copied from interface: Cursor
        Returns true if the value in the indicated column is null.
        Specified by:
        isNull in interface Cursor
        Specified by:
        isNull in class AbstractCursor
        Parameters:
        columnIndex - the zero-based index of the target column.
        Returns:
        whether the column value is null.
      • checkPosition

        protected void checkPosition()
        Description copied from class: AbstractCursor
        This function throws CursorIndexOutOfBoundsException if the cursor position is out of bounds. Subclass implementations of the get functions should call this before attempting to retrieve data.
        Overrides:
        checkPosition in class AbstractCursor
      • setWindow

        public void setWindow(CursorWindow window)
        Sets a new cursor window for the cursor to use.

        The cursor takes ownership of the provided cursor window; the cursor window will be closed when the cursor is closed or when the cursor adopts a new cursor window.

        If the cursor previously had a cursor window, then it is closed when the new cursor window is assigned.

        Parameters:
        window - The new cursor window, typically a remote cursor window.
      • hasWindow

        public boolean hasWindow()
        Returns true if the cursor has an associated cursor window.
        Returns:
        True if the cursor has an associated cursor window.
      • closeWindow

        protected void closeWindow()
        Closes the cursor window and sets mWindow to null.
      • clearOrCreateWindow

        protected void clearOrCreateWindow(String name)
        If there is a window, clear it. Otherwise, creates a new window.
        Parameters:
        name - The window name.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 322 / 158680781. Delta: 0.24413 с