|
| 1 | +/* |
| 2 | + * Copyright (C) 2006 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 | + |
| 17 | +package net.sqlcipher; |
| 18 | + |
| 19 | +/** |
| 20 | + * Extension of android.database.Cursor to support getType() for API < 11. |
| 21 | + */ |
| 22 | +public interface Cursor extends android.database.Cursor { |
| 23 | + /* |
| 24 | + * Values returned by {@link #getType(int)}. |
| 25 | + * These should be consistent with the corresponding types defined in CursorWindow.h |
| 26 | + */ |
| 27 | + /** Value returned by {@link #getType(int)} if the specified column is null */ |
| 28 | + static final int FIELD_TYPE_NULL = 0; |
| 29 | + |
| 30 | + /** Value returned by {@link #getType(int)} if the specified column type is integer */ |
| 31 | + static final int FIELD_TYPE_INTEGER = 1; |
| 32 | + |
| 33 | + /** Value returned by {@link #getType(int)} if the specified column type is float */ |
| 34 | + static final int FIELD_TYPE_FLOAT = 2; |
| 35 | + |
| 36 | + /** Value returned by {@link #getType(int)} if the specified column type is string */ |
| 37 | + static final int FIELD_TYPE_STRING = 3; |
| 38 | + |
| 39 | + /** Value returned by {@link #getType(int)} if the specified column type is blob */ |
| 40 | + static final int FIELD_TYPE_BLOB = 4; |
| 41 | + |
| 42 | + /** |
| 43 | + * Returns data type of the given column's value. |
| 44 | + * The preferred type of the column is returned but the data may be converted to other types |
| 45 | + * as documented in the get-type methods such as {@link #getInt(int)}, {@link #getFloat(int)} |
| 46 | + * etc. |
| 47 | + *<p> |
| 48 | + * Returned column types are |
| 49 | + * <ul> |
| 50 | + * <li>{@link #FIELD_TYPE_NULL}</li> |
| 51 | + * <li>{@link #FIELD_TYPE_INTEGER}</li> |
| 52 | + * <li>{@link #FIELD_TYPE_FLOAT}</li> |
| 53 | + * <li>{@link #FIELD_TYPE_STRING}</li> |
| 54 | + * <li>{@link #FIELD_TYPE_BLOB}</li> |
| 55 | + *</ul> |
| 56 | + *</p> |
| 57 | + * |
| 58 | + * @param columnIndex the zero-based index of the target column. |
| 59 | + * @return column value type |
| 60 | + */ |
| 61 | + int getType(int columnIndex); |
| 62 | +} |
0 commit comments