FileDocCategorySizeDatePackage
Singleton.javaAPI DocAndroid 5.1 API1072Thu Mar 12 22:22:10 GMT 2015android.util

Singleton

public abstract class Singleton extends Object
Singleton helper class for lazily initialization. Modeled after frameworks/base/include/utils/Singleton.h
hide

Fields Summary
private T
mInstance
Constructors Summary
Methods Summary
protected abstract Tcreate()

public final Tget()

        synchronized (this) {
            if (mInstance == null) {
                mInstance = create();
            }
            return mInstance;
        }