Java 类android.database.sqlite.SQLiteProgram 实例源码

项目:YuiHatano    文件:ShadowDatabaseUtils.java   
/**
 * Binds the given Object to the given SQLiteProgram using the proper
 * typing. For example, bind numbers as longs/doubles, and everything else
 * as a string by call toString() on it.
 *
 * @param prog  the program to bind the object to
 * @param index the 1-based index to bind at
 * @param value the value to bind
 */
public static void bindObjectToProgram(SQLiteProgram prog, int index, Object value) {
    if (value == null) {
        prog.bindNull(index);
    } else if (value instanceof Double || value instanceof Float) {
        prog.bindDouble(index, ((Number) value).doubleValue());
    } else if (value instanceof Number) {
        prog.bindLong(index, ((Number) value).longValue());
    } else if (value instanceof Boolean) {
        Boolean bool = (Boolean) value;
        if (bool) {
            prog.bindLong(index, 1);
        } else {
            prog.bindLong(index, 0);
        }
    } else if (value instanceof byte[]) {
        prog.bindBlob(index, (byte[]) value);
    } else {
        prog.bindString(index, value.toString());
    }
}
项目:KBUnitTest    文件:ShadowDatabaseUtils.java   
/**
 * Binds the given Object to the given SQLiteProgram using the proper
 * typing. For example, bind numbers as longs/doubles, and everything else
 * as a string by call toString() on it.
 *
 * @param prog  the program to bind the object to
 * @param index the 1-based index to bind at
 * @param value the value to bind
 */
public static void bindObjectToProgram(SQLiteProgram prog, int index, Object value) {
    if (value == null) {
        prog.bindNull(index);
    } else if (value instanceof Double || value instanceof Float) {
        prog.bindDouble(index, ((Number) value).doubleValue());
    } else if (value instanceof Number) {
        prog.bindLong(index, ((Number) value).longValue());
    } else if (value instanceof Boolean) {
        Boolean bool = (Boolean) value;
        if (bool) {
            prog.bindLong(index, 1);
        } else {
            prog.bindLong(index, 0);
        }
    } else if (value instanceof byte[]) {
        prog.bindBlob(index, (byte[]) value);
    } else {
        prog.bindString(index, value.toString());
    }
}
项目:core-doppl    文件:DatabaseUtils.java   
/**
 * Binds the given Object to the given SQLiteProgram using the proper
 * typing. For example, bind numbers as longs/doubles, and everything else
 * as a string by call toString() on it.
 *
 * @param prog the program to bind the object to
 * @param index the 1-based index to bind at
 * @param value the value to bind
 */
public static void bindObjectToProgram(SQLiteProgram prog, int index,
        Object value) {
    if (value == null) {
        prog.bindNull(index);
    } else if (value instanceof Double || value instanceof Float) {
        prog.bindDouble(index, ((Number)value).doubleValue());
    } else if (value instanceof Number) {
        prog.bindLong(index, ((Number)value).longValue());
    } else if (value instanceof Boolean) {
        Boolean bool = (Boolean)value;
        if (bool) {
            prog.bindLong(index, 1);
        } else {
            prog.bindLong(index, 0);
        }
    } else if (value instanceof byte[]){
        prog.bindBlob(index, (byte[]) value);
    } else {
        prog.bindString(index, value.toString());
    }
}
项目:squidb    文件:SquidCursorFactory.java   
public static void bindArgumentsToProgram(SQLiteProgram program, Object[] sqlArgs) {
    if (sqlArgs == null) {
        return;
    }
    for (int i = 1; i <= sqlArgs.length; i++) {
        DatabaseUtils.bindObjectToProgram(program, i, sqlArgs[i - 1]);
    }
}
项目:justintrain-client-android    文件:FrameworkSQLiteProgram.java   
FrameworkSQLiteProgram(SQLiteProgram delegate) {
    mDelegate = delegate;
}
项目:sqliteAsset    文件:FrameworkSQLiteProgram.java   
FrameworkSQLiteProgram(SQLiteProgram delegate) {
    mDelegate = delegate;
}
项目:Android_Code_Arbiter    文件:DatabaseUtils.java   
public static void bindObjectToProgram(SQLiteProgram prog, int index, Object value)
{
    throw new RuntimeException("Stub!");
}
项目:AndroidLife    文件:FrameworkSQLiteProgram.java   
FrameworkSQLiteProgram(SQLiteProgram delegate) {
    mDelegate = delegate;
}
项目:iBurn-Android    文件:FrameworkSQLiteProgram.java   
FrameworkSQLiteProgram(SQLiteProgram delegate) {
    mDelegate = delegate;
}