Code example for CursorIndexOutOfBoundsException

0
    /** 
     * Gets value at the given column for the current row. 
     */ 
    public Object get(int column) {
        if (column < 0 || column >= columnCount) {
            throw new CursorIndexOutOfBoundsException("Requested column: "
                    + column + ", # of columns: " +  columnCount);
        } 
        if (mPos < 0) {
            throw new CursorIndexOutOfBoundsException("Before first row.");
        } 
        if (mPos >= rowCount) {
            throw new CursorIndexOutOfBoundsException("After last row.");
        } 
        return data[mPos * columnCount + column];
    } 
 
    /** 
     * Adds a new row to the end and returns a builder for that row. Not safe 
     * for concurrent use. 
     *