SQLiteClosable

public abstract class SQLiteClosable
extends Object implements Closeable

java.lang.Object
   ↳ android.database.sqlite.SQLiteClosable


An object created from a SQLiteDatabase that can be closed. This class implements a primitive reference counting scheme for database objects.

Summary

Public constructors

SQLiteClosable()

Public methods

void acquireReference()

Acquires a reference to the object.

void close()

Releases a reference to the object, closing the object if the last reference was released.

void releaseReference()

Releases a reference to the object, closing the object if the last reference was released.

void releaseReferenceFromContainer()

This method was deprecated in API level 16. Do not use.

Protected methods

abstract void onAllReferencesReleased()

Called when the last reference to the object was released by a call to releaseReference() or close().

void onAllReferencesReleasedFromContainer()

This method was deprecated in API level 16. Do not use.

Inherited methods

Public constructors

SQLiteClosable

added in API level 1
public SQLiteClosable ()

Public methods

acquireReference

added in API level 1
public void acquireReference ()

Acquires a reference to the object.

Throws
IllegalStateException if the last reference to the object has already been released.

close

added in API level 1
public void close ()

Releases a reference to the object, closing the object if the last reference was released. Calling this method is equivalent to calling releaseReference().

releaseReference

added in API level 1
public void releaseReference ()

Releases a reference to the object, closing the object if the last reference was released.

releaseReferenceFromContainer

added in API level 1
public void releaseReferenceFromContainer ()

This method was deprecated in API level 16.
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.

Protected methods

onAllReferencesReleased

added in API level 1
protected abstract void onAllReferencesReleased ()

Called when the last reference to the object was released by a call to releaseReference() or close().

onAllReferencesReleasedFromContainer

added in API level 1
protected void onAllReferencesReleasedFromContainer ()

This method was deprecated in API level 16.
Do not use.

Called when the last reference to the object was released by a call to releaseReferenceFromContainer().