// Path: ContentProDemo/app/src/main/java/edu/cs4730/contentprodemo/data/Cube.java
// public class Cube {
//     String[]  Column;
// 
//     public Cube() {
//         Column = new String[] { "number", "cube"};
//     }
// 
//     //getone returns the val and the square of the val in cursor.
//     public Cursor getone(int val) {
//         //must return a Cursor, MatrixCursor is an editable cursor.
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         myCursor.addRow(new Object[] { val, val*val*val });
//         return myCursor;
//     }
// 
//     //returns the number and number of the number from 1 to 10.
//     public Cursor getall() {
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         for (int i=1; i<11; i++) {
//             myCursor.addRow(new Object[] { i, i*i*i});
//         }
//         return myCursor;
//     }
// }
// 
// Path: ContentProDemo/app/src/main/java/edu/cs4730/contentprodemo/data/Square.java
// public class Square {
// 
//     String[]  Column;
// 
//     public Square() {
//       Column = new String[] { "number", "square"};
//     }
// 
//     //getone returns the val and the square of the val in cursor.
//     public Cursor getone(int val) {
//         //must return a Cursor, MatrixCursor is an editable cursor.
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         myCursor.addRow(new Object[] { val, val*val});
//         return myCursor;
//     }
// 
//     //returns the number and number of the number from 1 to 10.
//     public Cursor getall() {
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         for (int i=1; i<11; i++) {
//             myCursor.addRow(new Object[] { i, i*i});
//         }
//         return myCursor;
//     }
// }


import androidx.annotation.NonNull;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;
import edu.cs4730.contentprodemo.data.Cube;
import edu.cs4730.contentprodemo.data.Square;
package edu.cs4730.contentprodemo;




/**
 * This example is to provide the very basics of a content provider.  It only returns
 * information, and ignores any attempts to updates/insert/delete.  The basic structure is here and
 * is intended for demonstration purposes.
 * <
 * This has two "tables".  it can provide squares or cubes
 * <p>
 * For a more complete and generic content provider connected to a database, please the sqlite repo,
 * myDBcontentProvider for more information.
 * <p>
 * Note if calling from another applications, it will need to have
 * <queries> <package android:name="edu.cs4730.contentprodemo" /> </queries> in the manifest file
 * starting in API 30 for package visibility additions.
 */

public class dummyCP extends ContentProvider {
    public static final String PROVIDER_NAME = "edu.cs4730.provider";

    //these two are not used, but normally handly to have avialabe in a normal provider.
    public static final Uri CONTENT_URI1 =
        Uri.parse("content://" + PROVIDER_NAME + "/square");
    public static final Uri CONTENT_URI2 =
        Uri.parse("content://" + PROVIDER_NAME + "/cube");

    private static final int SQUARE = 1;
    private static final int SQUARE_ID = 2;
    private static final int CUBE = 3;
    private static final int CUBE_ID = 4;

    private static final UriMatcher uriMatcher;

    static {
        uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
        uriMatcher.addURI(PROVIDER_NAME, "square", SQUARE);
        uriMatcher.addURI(PROVIDER_NAME, "square/#", SQUARE_ID);
        uriMatcher.addURI(PROVIDER_NAME, "cube", CUBE);
        uriMatcher.addURI(PROVIDER_NAME, "cube/#", CUBE_ID);
    }

    static final String TAG = "dummyCP";
// Path: ContentProDemo/app/src/main/java/edu/cs4730/contentprodemo/data/Cube.java
// public class Cube {
//     String[]  Column;
// 
//     public Cube() {
//         Column = new String[] { "number", "cube"};
//     }
// 
//     //getone returns the val and the square of the val in cursor.
//     public Cursor getone(int val) {
//         //must return a Cursor, MatrixCursor is an editable cursor.
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         myCursor.addRow(new Object[] { val, val*val*val });
//         return myCursor;
//     }
// 
//     //returns the number and number of the number from 1 to 10.
//     public Cursor getall() {
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         for (int i=1; i<11; i++) {
//             myCursor.addRow(new Object[] { i, i*i*i});
//         }
//         return myCursor;
//     }
// }
// 
// Path: ContentProDemo/app/src/main/java/edu/cs4730/contentprodemo/data/Square.java
// public class Square {
// 
//     String[]  Column;
// 
//     public Square() {
//       Column = new String[] { "number", "square"};
//     }
// 
//     //getone returns the val and the square of the val in cursor.
//     public Cursor getone(int val) {
//         //must return a Cursor, MatrixCursor is an editable cursor.
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         myCursor.addRow(new Object[] { val, val*val});
//         return myCursor;
//     }
// 
//     //returns the number and number of the number from 1 to 10.
//     public Cursor getall() {
//         MatrixCursor myCursor = new MatrixCursor(Column);
//         for (int i=1; i<11; i++) {
//             myCursor.addRow(new Object[] { i, i*i});
//         }
//         return myCursor;
//     }
// }


// Path: ContentProDemo/app/src/main/java/edu/cs4730/contentprodemo/dummyCP.java
import androidx.annotation.NonNull;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;
import edu.cs4730.contentprodemo.data.Cube;
import edu.cs4730.contentprodemo.data.Square;

package edu.cs4730.contentprodemo;




/**
 * This example is to provide the very basics of a content provider.  It only returns
 * information, and ignores any attempts to updates/insert/delete.  The basic structure is here and
 * is intended for demonstration purposes.
 * <
 * This has two "tables".  it can provide squares or cubes
 * <p>
 * For a more complete and generic content provider connected to a database, please the sqlite repo,
 * myDBcontentProvider for more information.
 * <p>
 * Note if calling from another applications, it will need to have
 * <queries> <package android:name="edu.cs4730.contentprodemo" /> </queries> in the manifest file
 * starting in API 30 for package visibility additions.
 */

public class dummyCP extends ContentProvider {
    public static final String PROVIDER_NAME = "edu.cs4730.provider";

    //these two are not used, but normally handly to have avialabe in a normal provider.
    public static final Uri CONTENT_URI1 =
        Uri.parse("content://" + PROVIDER_NAME + "/square");
    public static final Uri CONTENT_URI2 =
        Uri.parse("content://" + PROVIDER_NAME + "/cube");

    private static final int SQUARE = 1;
    private static final int SQUARE_ID = 2;
    private static final int CUBE = 3;
    private static final int CUBE_ID = 4;

    private static final UriMatcher uriMatcher;

    static {
        uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
        uriMatcher.addURI(PROVIDER_NAME, "square", SQUARE);
        uriMatcher.addURI(PROVIDER_NAME, "square/#", SQUARE_ID);
        uriMatcher.addURI(PROVIDER_NAME, "cube", CUBE);
        uriMatcher.addURI(PROVIDER_NAME, "cube/#", CUBE_ID);
    }

    static final String TAG = "dummyCP";
    Cube myCube;