FileDocCategorySizeDatePackage
BordeauxAggregatorManager.javaAPI DocAndroid 5.1 API5566Thu Mar 12 22:22:48 GMT 2015android.bordeaux.services

BordeauxAggregatorManager

public class BordeauxAggregatorManager extends Object
AggregatorManger for Learning framework.

Fields Summary
static final String
TAG
static final String
AggregatorManager_NOTAVAILABLE
private android.content.Context
mContext
private android.bordeaux.services.IAggregatorManager
mAggregatorManager
Constructors Summary
public BordeauxAggregatorManager(android.content.Context context)

        mContext = context;
        mAggregatorManager = BordeauxManagerService.getAggregatorManager(mContext);
    
Methods Summary
public java.util.MapGetData(java.lang.String dataName)

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return getMap(mAggregatorManager.getData(dataName));
        } catch (RemoteException e) {
            Log.e(TAG,"Exception in Getting " + dataName);
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }
    
public java.util.ListgetDayOfWeekValues()

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return mAggregatorManager.getDayOfWeekValues();
        } catch (RemoteException e) {
            Log.e(TAG,"Error getting day of week values");
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }
    
public booleangetFakeMode()

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return mAggregatorManager.getFakeMode();
        } catch (RemoteException e) {
            Log.e(TAG,"Error getting fake mode");
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }
    
public java.util.ListgetLocationClusters()

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return mAggregatorManager.getLocationClusters();
        } catch (RemoteException e) {
            Log.e(TAG,"Error getting location clusters");
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }
    
private java.util.MapgetMap(java.util.List sample)

        HashMap<String, String> map = new HashMap<String, String>();
        for (int i =0; i < sample.size(); i++) {
            map.put(sample.get(i).key, sample.get(i).value);
        }
        return (Map) map;
    
public java.util.ListgetTimeOfDayValues()

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return mAggregatorManager.getTimeOfDayValues();
        } catch (RemoteException e) {
            Log.e(TAG,"Error getting time of day values");
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }
    
public booleanretrieveAggregatorManager()


       
        if (mAggregatorManager == null) {
            mAggregatorManager = BordeauxManagerService.getAggregatorManager(mContext);
            if (mAggregatorManager == null) {
                Log.e(TAG, AggregatorManager_NOTAVAILABLE);
                return false;
            }
        }
        return true;
    
public booleansetFakeDayOfWeek(java.lang.String day_of_week)

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return mAggregatorManager.setFakeDayOfWeek(day_of_week);
        } catch (RemoteException e) {
            Log.e(TAG,"Error setting fake day of week:" + day_of_week);
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }
    
public booleansetFakeLocation(java.lang.String name)

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return mAggregatorManager.setFakeLocation(name);
        } catch (RemoteException e) {
            Log.e(TAG,"Error setting fake location:" + name);
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }
    
public booleansetFakeTimeOfDay(java.lang.String time_of_day)

        if (!retrieveAggregatorManager())
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        try {
            return mAggregatorManager.setFakeTimeOfDay(time_of_day);
        } catch (RemoteException e) {
            Log.e(TAG,"Error setting fake time of day:" + time_of_day);
            throw new RuntimeException(AggregatorManager_NOTAVAILABLE);
        }