public synchronized List<L> getListeners() { // Clone to protect against adding/removing listeners while running callbacks ArrayList<L> res = new ArrayList<>(_listeners); // Scan any auto listeners for (Map.Entry<L, Void> entry: _autoListeners.entrySet()) { res.add(entry.getKey()); } return res; }
public static void clearTintCache() { for (Map.Entry<Context, TintManager> entry : INSTANCE_CACHE.entrySet()) { TintManager tm = entry.getValue(); if (tm != null) tm.clear(); } COLOR_FILTER_CACHE.evictAll(); }
private void markAcquiredConnectionsLocked(AcquiredConnectionStatus status) { if (!mAcquiredConnections.isEmpty()) { ArrayList<SQLiteConnection> keysToUpdate = new ArrayList<SQLiteConnection>( mAcquiredConnections.size()); for (Map.Entry<SQLiteConnection, AcquiredConnectionStatus> entry : mAcquiredConnections.entrySet()) { AcquiredConnectionStatus oldStatus = entry.getValue(); if (status != oldStatus && oldStatus != AcquiredConnectionStatus.DISCARD) { keysToUpdate.add(entry.getKey()); } } final int updateCount = keysToUpdate.size(); for (int i = 0; i < updateCount; i++) { mAcquiredConnections.put(keysToUpdate.get(i), status); } } }
@Override public void onChange(final boolean selfChange, Uri uri) { if (uri == null) { // for sdk version 15 and below we cannot detect which exact data was changed. This will // return all data for this module uri = mTrayUri.builder().setModule(getModuleName()).build(); } // query only the changed items final List<TrayItem> trayItems = mProviderHelper.queryProviderSafe(uri); // clone to get around ConcurrentModificationException final Set<Map.Entry<OnTrayPreferenceChangeListener, Handler>> entries = new HashSet<>(mListeners.entrySet()); // notify all registered listeners for (final Map.Entry<OnTrayPreferenceChangeListener, Handler> entry : entries) { final OnTrayPreferenceChangeListener listener = entry.getKey(); final Handler handler = entry.getValue(); if (handler != null) { // call the listener on the thread where the listener was registered handler.post(new Runnable() { @Override public void run() { listener.onTrayPreferenceChanged(trayItems); } }); } else { listener.onTrayPreferenceChanged(trayItems); } } } }
if (!mAcquiredConnections.isEmpty()) { for (Map.Entry<SQLiteConnection, AcquiredConnectionStatus> entry : mAcquiredConnections.entrySet()) { final SQLiteConnection connection = entry.getKey(); connection.dumpUnsafe(indentedPrinter, verbose);
/** * A debugging routine. */ public synchronized void dump() { for (Map.Entry<Thread, ThreadStatus> entry : mThreadStatus.entrySet()) { Log.v(TAG, "[Dump] Thread " + entry.getKey() + " (" + entry.getKey().getId() + ")'s status is " + entry.getValue()); } }
/** * A debugging routine. */ public synchronized void dump() { for (Map.Entry<Thread, ThreadStatus> entry : mThreadStatus.entrySet()) { Log.v(TAG, "[Dump] Thread " + entry.getKey() + " (" + entry.getKey().getId() + ")'s status is " + entry.getValue()); } }
private void markAcquiredConnectionsLocked(AcquiredConnectionStatus status) { if (!mAcquiredConnections.isEmpty()) { ArrayList<SQLiteConnection> keysToUpdate = new ArrayList<SQLiteConnection>( mAcquiredConnections.size()); for (Map.Entry<SQLiteConnection, AcquiredConnectionStatus> entry : mAcquiredConnections.entrySet()) { AcquiredConnectionStatus oldStatus = entry.getValue(); if (status != oldStatus && oldStatus != AcquiredConnectionStatus.DISCARD) { keysToUpdate.add(entry.getKey()); } } final int updateCount = keysToUpdate.size(); for (int i = 0; i < updateCount; i++) { mAcquiredConnections.put(keysToUpdate.get(i), status); } } }
static List<Activity> getAllActivities() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { ArrayList<Activity> list = new ArrayList<>(); for (Map.Entry<Activity, Integer> e : sActivitiesRefs.entrySet()) { Activity a = e.getKey(); if (a != null && e.getValue().intValue() > 0) { list.add(a); } } return list; } else { return getActivities(Fastdex.get().getApplicationContext(),true); } }
static Activity getTopActivity() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { Activity r = null; for (Map.Entry<Activity, Integer> e : sActivitiesRefs.entrySet()) { Activity a = e.getKey(); if (a != null && e.getValue().intValue() == ACTIVITY_RESUMED) { r = a; } } return r; } else { return getForegroundActivity(Fastdex.get().getApplicationContext()); } }
/** * @return set of entries * @see java.util.Hashtable#entrySet() */ public Set<Entry<K,V>> entrySet() { return map.entrySet(); }// --------------------------------------------------------
private Set<Entry<Object, EqualBeans>> entrySet() { return _innerMap.entrySet(); } }
public synchronized List<L> getListeners() { // Clone to protect against adding/removing listeners while running callbacks ArrayList<L> res = new ArrayList<>(_listeners); // Scan any auto listeners for (Map.Entry<L, Void> entry: _autoListeners.entrySet()) { res.add(entry.getKey()); } return res; }
public synchronized List<L> getListeners() { // Clone to protect against adding/removing listeners while running callbacks ArrayList<L> res = new ArrayList<>(_listeners); // Scan any auto listeners for (Map.Entry<L, Void> entry: _autoListeners.entrySet()) { res.add(entry.getKey()); } return res; }
@Override public String[] getEntries() { LinkedList<String> out = new LinkedList<String>(); for (Map.Entry<?, ?> item : map.entrySet()) { out.add(item.getKey() + "=" + item.getValue()); } return out.toArray(new String[out.size()]); }
/** * A debugging routine. */ public synchronized void dump() { Iterator<Map.Entry<Thread, ThreadStatus>> i = mThreadStatus.entrySet().iterator(); while (i.hasNext()) { Map.Entry<Thread, ThreadStatus> entry = i.next(); Log.v(TAG, "[Dump] Thread " + entry.getKey() + " (" + entry.getKey().getId() + ")'s status is " + entry.getValue()); } }
public void dump(Appendable out, String indent) throws IOException { AggregateLifeCycle.dumpObject(out,this); AggregateLifeCycle.dump(out, indent, _beans.entrySet()); }
@Override public void dump(Appendable out, String indent) throws IOException { ContainerLifeCycle.dumpObject(out,this); ContainerLifeCycle.dump(out, indent, _beans.entrySet()); }
@Override public void dump(Appendable out, String indent) throws IOException { ContainerLifeCycle.dumpObject(out,this); ContainerLifeCycle.dump(out, indent, _beans.entrySet()); }
@Override public void dump(Appendable out, String indent) throws IOException { ContainerLifeCycle.dumpObject(out,this); ContainerLifeCycle.dump(out, indent, _beans.entrySet()); }