to top
Android APIs
public abstract class

SQLiteClosable

extends Object
implements Closeable
java.lang.Object
   ↳ android.database.sqlite.SQLiteClosable
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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 is deprecated. 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 is deprecated. Do not use.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public SQLiteClosable ()

Since: API Level 1

Public Methods

public void acquireReference ()

Since: API Level 1

Acquires a reference to the object.

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

public void close ()

Since: API Level 1

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

public void releaseReference ()

Since: API Level 1

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

public void releaseReferenceFromContainer ()

Since: API Level 1

This method is 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.

Protected Methods

protected abstract void onAllReferencesReleased ()

Since: API Level 1

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

protected void onAllReferencesReleasedFromContainer ()

Since: API Level 1

This method is deprecated.
Do not use.

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