// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.philips.lighting.hue.sdk.bridge.impl; import com.philips.lighting.model.PHBridgeConfiguration; import com.philips.lighting.model.PHBridgeResourcesCache; import com.philips.lighting.model.PHGroup; import com.philips.lighting.model.PHLight; import com.philips.lighting.model.PHScene; import com.philips.lighting.model.PHSchedule; import java.util.ArrayList; import java.util.Collection; import java.util.Hashtable; import java.util.Iterator; import java.util.List; public class PHBridgeResourcesCacheImpl implements PHBridgeResourcesCache { private PHBridgeConfiguration bridgeConfig; private Hashtable groups; private Hashtable lights; private Hashtable scenes; private Hashtable schedules; public PHBridgeResourcesCacheImpl() { } public List getAllGroups() { ArrayList arraylist = new ArrayList(); Iterator iterator = groups.values().iterator(); do { if (!iterator.hasNext()) { return arraylist; } arraylist.add((PHGroup)iterator.next()); } while (true); } public List getAllLights() { ArrayList arraylist = new ArrayList(); Iterator iterator = lights.values().iterator(); do { if (!iterator.hasNext()) { return arraylist; } arraylist.add((PHLight)iterator.next()); } while (true); } public List getAllScenes() { if (scenes != null) goto _L2; else goto _L1 _L1: Object obj = null; _L4: return ((List) (obj)); _L2: obj = scenes.values(); ArrayList arraylist = new ArrayList(); Iterator iterator = ((Collection) (obj)).iterator(); do { obj = arraylist; if (!iterator.hasNext()) { continue; } arraylist.add((PHScene)iterator.next()); } while (true); if (true) goto _L4; else goto _L3 _L3: } public List getAllSchedules(boolean flag) { Object obj = schedules.values(); ArrayList arraylist = new ArrayList(); obj = ((Collection) (obj)).iterator(); do { if (!((Iterator) (obj)).hasNext()) { return arraylist; } PHSchedule phschedule = (PHSchedule)((Iterator) (obj)).next(); if (flag && phschedule.getRecurringDays() != 0 && phschedule.getDate() != null) { arraylist.add(phschedule); } else if (!flag && phschedule.getRecurringDays() == 0 && phschedule.getDate() != null) { arraylist.add(phschedule); } } while (true); } public List getAllTimers(boolean flag) { Object obj = schedules.values(); ArrayList arraylist = new ArrayList(); obj = ((Collection) (obj)).iterator(); do { if (!((Iterator) (obj)).hasNext()) { return arraylist; } PHSchedule phschedule = (PHSchedule)((Iterator) (obj)).next(); if (flag && phschedule.getTimer() != 0 && phschedule.getRecurringTimerInterval() != 0) { arraylist.add(phschedule); } else if (!flag && phschedule.getTimer() != 0 && phschedule.getRecurringTimerInterval() == 0) { arraylist.add(phschedule); } } while (true); } public PHBridgeConfiguration getBridgeConfiguration() { return bridgeConfig; } public Hashtable getGroups() { return groups; } public Hashtable getLights() { return lights; } public Hashtable getScenes() { return scenes; } public Hashtable getSchedules() { return schedules; } public void setBridgeConfiguration(PHBridgeConfiguration phbridgeconfiguration) { bridgeConfig = phbridgeconfiguration; } public void setGroups(Hashtable hashtable) { groups = hashtable; } public void setLights(Hashtable hashtable) { lights = hashtable; } public void setScenes(Hashtable hashtable) { scenes = hashtable; } public void setSchedules(Hashtable hashtable) { schedules = hashtable; } }