1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package androidx.sqlite.db.framework;
18
19import android.database.sqlite.SQLiteStatement;
20
21import androidx.sqlite.db.SupportSQLiteStatement;
22
23/**
24 * Delegates all calls to a {@link SQLiteStatement}.
25 */
26class FrameworkSQLiteStatement extends FrameworkSQLiteProgram implements SupportSQLiteStatement {
27    private final SQLiteStatement mDelegate;
28
29    /**
30     * Creates a wrapper around a framework {@link SQLiteStatement}.
31     *
32     * @param delegate The SQLiteStatement to delegate calls to.
33     */
34    FrameworkSQLiteStatement(SQLiteStatement delegate) {
35        super(delegate);
36        mDelegate = delegate;
37    }
38
39    @Override
40    public void execute() {
41        mDelegate.execute();
42    }
43
44    @Override
45    public int executeUpdateDelete() {
46        return mDelegate.executeUpdateDelete();
47    }
48
49    @Override
50    public long executeInsert() {
51        return mDelegate.executeInsert();
52    }
53
54    @Override
55    public long simpleQueryForLong() {
56        return mDelegate.simpleQueryForLong();
57    }
58
59    @Override
60    public String simpleQueryForString() {
61        return mDelegate.simpleQueryForString();
62    }
63}
64