Sha256: cf15cbaaa57698e44b919a4dc3e6c01ea78f5345ad850245a21bf2f4ccf0a4af
Contents?: true
Size: 828 Bytes
Versions: 12
Compression:
Stored size: 828 Bytes
Contents
package com.rhomobile.rhodes.api; import java.util.HashMap; import java.util.Map; public abstract class RhoApiFactory <IApi extends IRhoApiObject, IApiSingleton> { IApiSingleton mApiSingleton; Map<String, IApi> mApiObjects; public RhoApiFactory() { mApiObjects = new HashMap<String, IApi>(); } public IApiSingleton getApiSingleton() { if (mApiSingleton == null) mApiSingleton = createSingleton(); return mApiSingleton; } public IApi getApiObject(String id) { IApi obj = mApiObjects.get(id); if (obj == null) { obj = createApiObject(id); mApiObjects.put(id, obj); } return obj; } protected abstract IApiSingleton createSingleton(); protected abstract IApi createApiObject(String id); }
Version data entries
12 entries across 12 versions & 2 rubygems