Lines Matching defs:Collection

42 import java.util.Collection;
72 * {@link Collection} classes.
107 public static <K, V> Multimap<K, V> newMultimap(Map<K, Collection<V>> map,
108 final Supplier<? extends Collection<V>> factory) {
113 transient Supplier<? extends Collection<V>> factory;
115 CustomMultimap(Map<K, Collection<V>> map,
116 Supplier<? extends Collection<V>> factory) {
121 @Override protected Collection<V> createCollection() {
141 factory = (Supplier<? extends Collection<V>>) stream.readObject();
142 Map<K, Collection<V>> map = (Map<K, Collection<V>>) stream.readObject();
189 Map<K, Collection<V>> map, final Supplier<? extends List<V>> factory) {
197 CustomListMultimap(Map<K, Collection<V>> map,
221 Map<K, Collection<V>> map = (Map<K, Collection<V>>) stream.readObject();
267 Map<K, Collection<V>> map, final Supplier<? extends Set<V>> factory) {
275 CustomSetMultimap(Map<K, Collection<V>> map,
299 Map<K, Collection<V>> map = (Map<K, Collection<V>>) stream.readObject();
344 Map<K, Collection<V>> map,
354 CustomSortedSetMultimap(Map<K, Collection<V>> map,
384 Map<K, Collection<V>> map = (Map<K, Collection<V>>) stream.readObject();
490 transient Collection<Entry<K, V>> entries;
493 transient Collection<V> values;
494 transient Map<K, Collection<V>> map;
508 @Override public Map<K, Collection<V>> asMap() {
509 Map<K, Collection<V>> result = map;
511 final Map<K, Collection<V>> unmodifiableMap
513 map = result = new ForwardingMap<K, Collection<V>>() {
514 @Override protected Map<K, Collection<V>> delegate() {
518 Set<Entry<K, Collection<V>>> entrySet;
520 @Override public Set<Map.Entry<K, Collection<V>>> entrySet() {
521 Set<Entry<K, Collection<V>>> result = entrySet;
528 @Override public Collection<V> get(Object key) {
529 Collection<V> collection = unmodifiableMap.get(key);
534 Collection<Collection<V>> asMapValues;
536 @Override public Collection<Collection<V>> values() {
537 Collection<Collection<V>> result = asMapValues;
552 @Override public Collection<Entry<K, V>> entries() {
553 Collection<Entry<K, V>> result = entries;
560 @Override public Collection<V> get(K key) {
597 @Override public Collection<V> removeAll(Object key) {
601 @Override public Collection<V> replaceValues(
606 @Override public Collection<V> values() {
607 Collection<V> result = values;
618 extends ForwardingCollection<Collection<V>> {
619 final Collection<Collection<V>> delegate;
620 UnmodifiableAsMapValues(Collection<Collection<V>> delegate) {
623 @Override protected Collection<Collection<V>> delegate() {
626 @Override public Iterator<Collection<V>> iterator() {
627 final Iterator<Collection<V>> iterator = delegate.iterator();
628 return new Iterator<Collection<V>>() {
634 public Collection<V> next() {
652 @Override public boolean containsAll(Collection<?> c) {
884 * {@code Collection}, in that order of preference.
889 private static <V> Collection<V> unmodifiableValueCollection(
890 Collection<V> collection) {
912 private static <K, V> Map.Entry<K, Collection<V>> unmodifiableAsMapEntry(
913 final Map.Entry<K, Collection<V>> entry) {
915 return new AbstractMapEntry<K, Collection<V>>() {
920 @Override public Collection<V> getValue() {
935 private static <K, V> Collection<Entry<K, V>> unmodifiableEntries(
936 Collection<Entry<K, V>> entries) {
954 private static <K, V> Set<Entry<K, Collection<V>>> unmodifiableAsMapEntries(
955 Set<Entry<K, Collection<V>>> asMapEntries) {
962 extends ForwardingSet<Entry<K, Collection<V>>> {
963 private final Set<Entry<K, Collection<V>>> delegate;
964 UnmodifiableAsMapEntries(Set<Entry<K, Collection<V>>> delegate) {
968 @Override protected Set<Entry<K, Collection<V>>> delegate() {
972 @Override public Iterator<Entry<K, Collection<V>>> iterator() {
973 final Iterator<Entry<K, Collection<V>>> iterator = delegate.iterator();
974 return new ForwardingIterator<Entry<K, Collection<V>>>() {
975 @Override protected Iterator<Entry<K, Collection<V>>> delegate() {
978 @Override public Entry<K, Collection<V>> next() {
996 @Override public boolean containsAll(Collection<?> c) {
1030 transient Map<K, Collection<V>> asMap;
1148 public Collection<V> values() {
1158 public Map<K, Collection<V>> asMap() {
1159 Map<K, Collection<V>> result = asMap;
1195 class AsMapEntries extends AbstractSet<Entry<K, Collection<V>>> {
1200 @Override public Iterator<Entry<K, Collection<V>>> iterator() {
1201 return new Iterator<Entry<K, Collection<V>>>() {
1209 public Entry<K, Collection<V>> next() {
1211 return new AbstractMapEntry<K, Collection<V>>() {
1215 @Override public Collection<V> getValue() {
1256 class AsMap extends Maps.ImprovedAbstractMap<K, Collection<V>> {
1257 @Override protected Set<Entry<K, Collection<V>>> createEntrySet() {
1268 @Override public Collection<V> get(Object key) {
1269 Collection<V> collection = MapMultimap.this.get((K) key);
1273 @Override public Collection<V> remove(Object key) {
1274 Collection<V> collection = removeAll(key);
1312 * {@code get()} will return a general {@code Collection} as opposed to a
1374 * {@code get()} will return a general {@code Collection} as opposed to a
1412 Collection<V2> transform(final K key, Collection<V1> values) {
1420 private transient Map<K, Collection<V2>> asMap;
1422 @Override public Map<K, Collection<V2>> asMap() {
1424 Map<K, Collection<V2>> aM = Maps.transformEntries(fromMultimap.asMap(),
1425 new EntryTransformer<K, Collection<V1>, Collection<V2>>() {
1427 @Override public Collection<V2> transformEntry(
1428 K key, Collection<V1> value) {
1444 Collection<V2> values = get((K) key);
1456 private transient Collection<Entry<K, V2>> entries;
1458 @Override public Collection<Entry<K, V2>> entries() {
1460 Collection<Entry<K, V2>> es = new TransformedEntries(transformer);
1502 Collection<V2> values = get((K) entry.getKey());
1510 @Override public Collection<V2> get(final K key) {
1545 @Override public Collection<V2> removeAll(Object key) {
1549 @Override public Collection<V2> replaceValues(
1558 private transient Collection<V2> values;
1560 @Override public Collection<V2> values() {
1562 Collection<V2> vs = Collections2.transform(
1717 @Override List<V2> transform(final K key, Collection<V1> values) {
1865 final Iterator<Map.Entry<K, Collection<V>>> backingIterator =
1873 final Map.Entry<K, Collection<V>> backingEntry =
1920 Collection<V> collection = multimap().asMap().get(entry.getElement());
1929 Collection<V> collection = multimap().asMap().get(entry.getElement());
1955 Collection<V> values = multimap().asMap().get(element);
1972 Collection<V> values;
2091 Maps.ImprovedAbstractMap<K, Collection<V>> {
2096 abstract Iterator<Entry<K, Collection<V>>> entryIterator();
2098 @Override protected Set<Entry<K, Collection<V>>> createEntrySet() {
2106 class EntrySet extends Maps.EntrySet<K, Collection<V>> {
2107 @Override Map<K, Collection<V>> map() {
2111 @Override public Iterator<Entry<K, Collection<V>>> iterator() {
2126 @Override public Collection<V> get(Object key) {
2130 @Override public Collection<V> remove(Object key) {
2351 @Override public Collection<V> replaceValues(K key, Iterable<? extends V> values) {
2357 Collection<V> oldValues = removeAll(key);
2362 @Override public Collection<V> removeAll(Object key) {
2364 Collection<V> values = unfiltered.asMap().get(key);
2415 Collection<V> filterCollection(Collection<V> collection, Predicate<V> predicate) {
2423 @Override public Collection<V> get(K key) {
2431 Collection<V> values;
2433 @Override public Collection<V> values() {
2460 @Override public boolean removeAll(Collection<?> c) {
2473 @Override public boolean retainAll(Collection<?> c) {
2487 Collection<Entry<K, V>> entries;
2489 @Override public Collection<Entry<K, V>> entries() {
2498 boolean removeEntriesIf(Predicate<Map.Entry<K, Collection<V>>> removalPredicate) {
2499 Iterator<Map.Entry<K, Collection<V>>> iterator = unfiltered.asMap().entrySet().iterator();
2503 Map.Entry<K, Collection<V>> entry = iterator.next();
2505 Collection<V> collection = entry.getValue();
2507 Collection<V> filteredCollection = filterCollection(collection, valuePredicate);
2508 Map.Entry<K, Collection<V>> filteredEntry = Maps.immutableEntry(key, filteredCollection);
2521 Map<K, Collection<V>> asMap;
2523 @Override public Map<K, Collection<V>> asMap() {
2527 static final Predicate<Collection<?>> NOT_EMPTY = new Predicate<Collection<?>>() {
2528 @Override public boolean apply(Collection<?> input) {
2533 Map<K, Collection<V>> createAsMap() {
2535 EntryTransformer<K, Collection<V>, Collection<V>> transformer
2536 = new EntryTransformer<K, Collection<V>, Collection<V>>() {
2537 @Override public Collection<V> transformEntry(K key, Collection<V> collection) {
2541 Map<K, Collection<V>> transformed
2545 Map<K, Collection<V>> filtered = Maps.filterValues(transformed, NOT_EMPTY);
2552 class AsMap extends ForwardingMap<K, Collection<V>> {
2553 final Map<K, Collection<V>> delegate;
2555 AsMap(Map<K, Collection<V>> delegate) {
2559 @Override protected Map<K, Collection<V>> delegate() {
2563 @Override public Collection<V> remove(Object o) {
2564 Collection<V> output = FilteredMultimap.this.removeAll(o);
2578 class KeySet extends Maps.KeySet<K, Collection<V>> {
2579 @Override Map<K, Collection<V>> map() {
2584 Collection<V> collection = delegate.get(o);
2592 @Override public boolean removeAll(Collection<?> c) {
2596 @Override public boolean retainAll(final Collection<?> c) {
2597 Predicate<Map.Entry<K, Collection<V>>> removalPredicate
2598 = new Predicate<Map.Entry<K, Collection<V>>>() {
2599 @Override public boolean apply(Map.Entry<K, Collection<V>> entry) {
2609 @Override public Collection<Collection<V>> values() {
2613 class Values extends Maps.Values<K, Collection<V>> {
2614 @Override Map<K, Collection<V>> map() {
2619 for (Collection<V> collection : this) {
2628 @Override public boolean removeAll(final Collection<?> c) {
2629 Predicate<Map.Entry<K, Collection<V>>> removalPredicate
2630 = new Predicate<Map.Entry<K, Collection<V>>>() {
2631 @Override public boolean apply(Map.Entry<K, Collection<V>> entry) {
2638 @Override public boolean retainAll(final Collection<?> c) {
2639 Predicate<Map.Entry<K, Collection<V>>> removalPredicate
2640 = new Predicate<Map.Entry<K, Collection<V>>>() {
2641 @Override public boolean apply(Map.Entry<K, Collection<V>> entry) {
2651 @Override public Set<Map.Entry<K, Collection<V>>> entrySet() {
2655 class EntrySet extends Maps.EntrySet<K, Collection<V>> {
2656 Set<Map.Entry<K, Collection<V>>> delegateEntries;
2658 public EntrySet(Set<Map.Entry<K, Collection<V>>> delegateEntries) {
2662 @Override Map<K, Collection<V>> map() {
2666 @Override public Iterator<Map.Entry<K, Collection<V>>> iterator() {
2673 Collection<V> collection = delegate.get(entry.getKey());
2682 @Override public boolean removeAll(Collection<?> c) {
2686 @Override public boolean retainAll(final Collection<?> c) {
2687 Predicate<Map.Entry<K, Collection<V>>> removalPredicate
2688 = new Predicate<Map.Entry<K, Collection<V>>>() {
2689 @Override public boolean apply(Map.Entry<K, Collection<V>> entry) {
2711 Collection<V> values = unfiltered.asMap().get(o);
2735 @Override public boolean removeAll(Collection<?> c) {
2739 @Override public boolean retainAll(final Collection<?> c) {
2740 Predicate<Map.Entry<K, Collection<V>>> removalPredicate
2741 = new Predicate<Map.Entry<K, Collection<V>>>() {
2742 @Override public boolean apply(Map.Entry<K, Collection<V>> entry) {