Package android.database.sqlite
Class SQLiteClosable
- java.lang.Object
-
- android.database.sqlite.SQLiteClosable
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
CursorWindow,SQLiteDatabase,SQLiteProgram
public abstract class SQLiteClosable extends Object implements Closeable
An object created from a SQLiteDatabase that can be closed. This class implements a primitive reference counting scheme for database objects.
-
-
Constructor Summary
Constructors Constructor Description SQLiteClosable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidacquireReference()Acquires a reference to the object.voidclose()Releases a reference to the object, closing the object if the last reference was released.protected abstract voidonAllReferencesReleased()Called when the last reference to the object was released by a call toreleaseReference()orclose().protected voidonAllReferencesReleasedFromContainer()Deprecated.Do not use.voidreleaseReference()Releases a reference to the object, closing the object if the last reference was released.voidreleaseReferenceFromContainer()Deprecated.Do not use.
-
-
-
Method Detail
-
onAllReferencesReleased
protected abstract void onAllReferencesReleased()
Called when the last reference to the object was released by a call toreleaseReference()orclose().
-
onAllReferencesReleasedFromContainer
@Deprecated protected void onAllReferencesReleasedFromContainer()
Deprecated.Do not use.Called when the last reference to the object was released by a call toreleaseReferenceFromContainer().
-
acquireReference
public void acquireReference()
Acquires a reference to the object.- Throws:
IllegalStateException- if the last reference to the object has already been released.
-
releaseReference
public void releaseReference()
Releases a reference to the object, closing the object if the last reference was released.- See Also:
onAllReferencesReleased()
-
releaseReferenceFromContainer
@Deprecated public void releaseReferenceFromContainer()
Deprecated.Do not use.Releases a reference to the object that was owned by the container of the object, closing the object if the last reference was released.- See Also:
onAllReferencesReleasedFromContainer()
-
close
public void close()
Releases a reference to the object, closing the object if the last reference was released. Calling this method is equivalent to callingreleaseReference().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- See Also:
releaseReference(),onAllReferencesReleased()
-
-