@Override public ListenableSet<Entry<K, V>> entrySet() { synchronized (mutex) { return new SynchronizedListenableSet<Entry<K,V>>(super.entrySet(), mutex); } } @Override
@Override public ListenableCollection<V> values() { return ListenableCollections.unmodifiableCollection(listenableMap.values()); } @Override
void propagateRemoved(Collection<Map.Entry<K, V>> entries) { if (keySet != null) keySet.collectionSupport.fireRemoved(keySet, new AdaptedCollection<Map.Entry<K,V>, K>(entries, entryToKeyAdapter)); if (entrySet != null) { entrySet.collectionSupport.fireRemoved(entrySet, entries); } if (values != null) { valuesSupport.fireRemoved(values, new AdaptedCollection<Map.Entry<K,V>, V>(entries, entryToValueAdapter)); } }
public ListenableCollection<V> values() { if (values == null) { valuesSupport = new ListenableSupport<V>(); values = ListenableCollections.unmodifiableCollection(new DefaultListenableCollection<V>(map.values(), valuesSupport)); } return values; }
@Override public ListenableSet<K> listenableKeySet() { return new UnmodifiableListenableSet<K>(listenableMap.keySet()); } @Override
@Override public ListenableCollection<V> values() { synchronized (mutex) { return new SynchronizedListenableCollection<V>(super.values()); } }
@Override public ListenableSet<Entry<K, V>> entrySet() { return ListenableCollections.unmodifiableSet(listenableMap.entrySet()); } @Override
@Override public ListenableSet<K> keySet() { synchronized (mutex) { return new SynchronizedListenableSet<K>(super.keySet()); } } @Override
public void removeCollectionListener(CollectionListener<V> l) { if (collectionSupport == null) return; collectionSupport.removeCollectionListener(l); } }
@Override public boolean isEmpty() { synchronized (mutex) { return super.isEmpty(); } }
@Override public V remove(Object key) { synchronized (mutex) { return super.remove(key); } } @Override
@Override public void clear() { synchronized (mutex) { super.clear(); } } @Override
@Override public boolean isEmpty() { synchronized (mutex) { return super.isEmpty(); } }
@Override public Iterator<T> iterator() { synchronized (mutex) { return new SynchronizedListenableIterator();//super.iterator()); } } @Override
@Override public String toString() { synchronized (mutex) { return super.toString(); } }
public MapResult(Threads threads, ListenableList<V> out, ListenableList<Pair<U,Throwable>> errorsOut) { this.values = ListenableCollections.unmodifiableList(out); this.threads = threads; this.errors = ListenableCollections.unmodifiableList(errorsOut); }
@Override public ListenableSet<K> keySet() { return new UnmodifiableListenableSet<K>(listenableMap.keySet()); //return Collections.unmodifiableSet(listenableMap.keySet()); } @Override