@Override public MutableSet<T> tap(Procedure<? super T> procedure) { Iterate.forEach(this.delegate, procedure); return this; }
public void combineAll(Iterable<BT> thingsToCombine) { Iterate.forEach(thingsToCombine, new Procedure<BT>() { public void value(BT object) { AbstractProcedureCombiner.this.combineOne(object); } }); }
public void value(final K key, Iterable<V> values) { Iterate.forEach(values, new Procedure<V>() { public void value(V value) { result.put(value, key); } }); } });
public void value(final K key, Iterable<V> values) { Iterate.forEach(values, new Procedure<V>() { public void value(V value) { result.put(value, key); } }); } });
public SynchronizedPutTreeSortedSetMultimap(Iterable<Pair<K, V>> inputIterable) { this(); Iterate.forEach(inputIterable, new Procedure<Pair<K, V>>() { public void value(Pair<K, V> pair) { SynchronizedPutTreeSortedSetMultimap.this.add(pair); } }); }
@Override public MutableSortedSet<T> tap(Procedure<? super T> procedure) { Iterate.forEach(this.delegate, procedure); return this; }
public void value(Iterable<E> iterable) { Iterate.forEach(iterable, new Procedure<E>() { public void value(E object) { objectIntProcedure.value(object, index.getCount()); index.increment(); } }); } });
public void each(final Procedure<? super V> procedure) { Iterate.forEach(this.adapted, new Procedure<T>() { public void value(T each) { Iterate.forEach(FlatCollectIterable.this.function.valueOf(each), procedure); } }); }
public SynchronizedPutFastListMultimap(Iterable<Pair<K, V>> inputIterable) { this(); Iterate.forEach(inputIterable, new Procedure<Pair<K, V>>() { public void value(Pair<K, V> pair) { SynchronizedPutFastListMultimap.this.add(pair); } }); }
public void value(T each) { Iterate.forEach(ParallelFlatCollectListIterable.this.function.valueOf(each), procedure); } });
@Override public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) { Iterate.forEach(this.adapted, new IfObjectIntProcedure<T>(this.predicate, objectIntProcedure)); }
public void value(T each) { Iterate.forEach(FlatCollectListBatch.this.function.valueOf(each), procedure); } });
public CollectionAdapter<T> withAll(Iterable<? extends T> elements) { Iterate.forEach(elements, new CollectionAddProcedure<T>(this.delegate)); return this; }
public CollectionAdapter<T> withoutAll(Iterable<? extends T> elements) { Iterate.forEach(elements, new CollectionRemoveProcedure<T>(this.delegate)); return this; }
public void value(final T each, final int occurrences) { Iterable<V> values = function.valueOf(each); Iterate.forEach(values, new Procedure<V>() { public void value(V value) { target.putAll(value, Collections.nCopies(occurrences, each)); } }); } });
public void value(T each) { Iterate.forEach(ParallelFlatCollectIterable.this.function.valueOf(each), procedure); } });
public <E> MutableSortedMap<K, V> collectKeysAndValues( Iterable<E> iterable, Function<? super E, ? extends K> keyFunction, Function<? super E, ? extends V> valueFunction) { Iterate.forEach(iterable, new MapCollectProcedure<E, K, V>(this, keyFunction, valueFunction)); return this; }
public <E> MutableMap<K, V> collectKeysAndValues( Iterable<E> iterable, Function<? super E, ? extends K> keyFunction, Function<? super E, ? extends V> valueFunction) { Iterate.forEach(iterable, new MapCollectProcedure<E, K, V>(this, keyFunction, valueFunction)); return this; }
/** * Iterate over the specified collection applying the specified Function to each element to calculate * a key and return the results as a Map. */ public static <T, K> MutableMap<K, T> toMap( Iterable<T> iterable, Function<? super T, ? extends K> keyFunction) { MutableMap<K, T> map = UnifiedMap.newMap(); Iterate.forEach(iterable, new MapCollectProcedure<T, K, T>(map, keyFunction)); return map; }
public static <T> TreeSortedSet<T> newSet(Iterable<? extends T> source) { if (source instanceof SortedSet<?>) { return new TreeSortedSet<T>((SortedSet<T>) source); } TreeSortedSet<T> sortedSet = TreeSortedSet.newSet(); Iterate.forEach(source, CollectionAddProcedure.on(sortedSet)); return sortedSet; }