package com.example.database4
//The SQL library functions keep track of a "cursor" which where you are in the output
import android.database.Cursor
import android.database.CursorWrapper

class MovieCursorWrapper (cursor: Cursor) : CursorWrapper(cursor) {

    val stuff:MovieStuff
        get() {
            val TITLE = getString (getColumnIndex(MovieTable.Cols.TITLE))
            val GENRE = getString (getColumnIndex(MovieTable.Cols.GENRE))
            val YEAR = getInt (getColumnIndex(MovieTable.Cols.YEAR))
            val DESCRIPTION = getString (getColumnIndex(MovieTable.Cols.DESCRIPTION))
            val ID = getInt (getColumnIndex(MovieTable.Cols.ID))
            return MovieStuff (TITLE,GENRE,YEAR,DESCRIPTION,ID)
        }
}

//This inherits from CursorWrapper and it puts specific movie information inside this class/object
//where we can access it easily.

//When SQL reads a database it returns a 2-dimensional grid of string.  This class DOES NOT
//read from the database itself.  It takes one row of the output and puts the information into
//a convenient MovieStuff object for ease of use later.


