A parallel form of forEachKeyValue.

@see MapIterate#forEachKeyValue(Map, Procedure2)
@see ParallelIterate
507260
public static <K, V> void forEachKeyValue(
            Map<K, V> map,
            Procedure2<? super K, ? super V> procedure,
            Executor executor)
    {
        ParallelMapIterate.forEachKeyValue(map, procedure, 2, map.size(), executor);
    }
615784
public static <K, V> ImmutableMap<K, V> mapFromPairedKeyValueSequences(
      final Iterable<K> keys, final Iterable<V> values) {
    final ImmutableMap.Builder<K, V> builder = ImmutableMap.builder();
    for (final ZipPair<K, V> pair : zip(keys, values)) {
      builder.put(pair.first(), pair.second());
    }
    return builder.build();
  }
761689
public static <K, V> ArrayList<V> valuesOfKeys(Map<K, V> map, Iterator<K> keys) {
		final ArrayList<V> values = new ArrayList<>();
		while (keys.hasNext()) {
			values.add(map.get(keys.next()));
		}
		return values;
	}
170751
public Collection<V> values() {
       Set<Map.Entry<K, V>> s = entrySet();
       ArrayList l = new ArrayList(s.size());
       for (Map.Entry e : s) 
           l.add(e.getValue());
       return l;
    }


    /**
     * Return a filtered set of keys.
     * @see Map.keySet
     */
    public Set<K> keySet() {
       Set<Map.Entry<K, V>> s = entrySet();
       HashSet keys = new HashSet(s.size());
       for (Map.Entry e : mBackingMap.entrySet())
           keys.add(e.getKey());
       return keys;
    }


    /**
     * Delegates to backing map.
     * @see java.util.Map.clear()
     */
    public void clear() { 
        mBackingMap.clear(); 
    }


    /**
     * Delegates to backing map.
     * @see java.util.Map.containsKey
     */
    public boolean containsKey(Object key) { 
        return mBackingMap.containsKey(key); 
    }


    /**
     * Delegates to backing map.
     * @see java.util.Map.containsValue
     */
    public boolean containsValue(Object value) {
       return mBackingMap.containsValue(value);
    }

    
    /**
     * Delegates to backing map.
     * @see Object.equals.
     */
    public boolean equals(Object o) {
       return mBackingMap.equals(o);
    }


    /**
     * Delegates to backing map.
     * @see Object.hashCode
     */
    public int hashCode() {
       return mBackingMap.hashCode();
    }


    /**
     * Delegates to backing map.
     * @see java.util.Map.get
     */
    public V get(Object key) {
       return mBackingMap.get(key);
    }

    
    /**
     * Delegates to backing map.
     * @see java.util.Map.isEmpty
     */
    public boolean isEmpty() {
       return mBackingMap.isEmpty();
    }


    /**
     * Delegates to backing map.
     * @see java.util.Map.put
     */
    public V put(K key, V value) {
        return mBackingMap.put(key, value);
    }


    /**
     * Delegates to backing map.
     * @see java.util.Map.putAll
     */
    public void putAll(Map<? extends K,? extends V> m) {
        mBackingMap.putAll(m);
    }
    

    /**
     * Delegates to backing map.
     * @see java.util.Map.remove
     */
    public V remove(Object key) {
        return mBackingMap.remove(key);
    }


    /**
     * Delegates to backing map.
     * @see java.util.Map.size
     */
    public int size() {
        return mBackingMap.size();
    }


    /**
     * Filter interface.
     */
    public interface Filter {
        /**
         * Returns true if the given entry should be included.
         */
        public boolean accept(Map.Entry e);
    }


}
364321
public static <K, V> MutableMap<K, V> selectMapOnValue(Map<K, V> map, final Predicate<? super V> predicate)
    {
        MutableMap<K, V> resultMap = UnifiedMap.newMap();
        final Procedure2<K, V> mapTransferProcedure = new MapPutProcedure<K, V>(resultMap);
        Procedure2<K, V> procedure = new Procedure2<K, V>()
        {
            public void value(K key, V value)
            {
                if (predicate.accept(value))
                {
                    mapTransferProcedure.value(key, value);
                }
            }
        };
        MapIterate.forEachKeyValue(map, procedure);
        return resultMap;
    }
402791
@Override
	public Collection<Object> values() {
		lock.readLock().lock();
		try {
			final List<Object> result = new LinkedList<Object>();
			final boolean useLocalPrefixes = !mixDefaultAndLocalPrefixes && hasLocalPrefixConfigurations();
			for (final Object key : getKeyMap(false).values()) {
				result.add(get(key, useLocalPrefixes));
			}
			return result;
		} finally {
			lock.readLock().unlock();
		}
	}
824837
public SetMultimap<A, B> getKeyValueMultimap() {
    SetMultimap<A, B> map = HashMultimap.create();
    for (A key : keySet()) {
      for (B value : getValues(key)) {
        map.put(key, value);
      }
    }
    return map;
  }
1369722
static List<String> keyValueString(@Nullable Map<?, ?> keyValueMapping) {
    List<String> result = Lists.newArrayList();
    if (keyValueMapping != null && keyValueMapping.size() > 0) {
      for (Map.Entry<?, ?> entry : keyValueMapping.entrySet()) {
        result.add(entry.getKey() + "=" + entry.getValue());
      }
      Joiner joiner = Joiner.on(",");
      return Collections.singletonList(joiner.join(result));
    }

    return Collections.emptyList();
  }
1196196
public  <R1> Unrestricted<R1> forEach2(Function<? super T, Unrestricted<R1>> value2) {


        return this.flatMap(in -> {

            Unrestricted<R1> a = value2.apply(in);
            return a;
        });



    }
58178
public void map(K1 key, V1 value,
                  OutputCollector<Text, Text> output, Reporter reporter) throws IOException {

    Iterator iter = this.aggregatorDescriptorList.iterator();
    while (iter.hasNext()) {
      ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next();
      Iterator<Entry<Text, Text>> ens =
        ad.generateKeyValPairs(key, value).iterator();
      while (ens.hasNext()) {
        Entry<Text, Text> en = ens.next();
        output.collect(en.getKey(), en.getValue());
      }
    }
  }
411342
@Override
  public void map(K key, V value, Context context
                  ) throws IOException, InterruptedException {
    context.write(value, key);
  }
10949
public boolean forEachPartition(IterateProcedure<E> p) {
        int curIdx = index.get(values.get(0).id());
        int from;
        int to;
        for (from = 0, to = 0; to < values.size(); to++) {
            int cIdx = index.get(values.get(to).id());
            if (curIdx != cIdx) {
                if (!p.extract(this, curIdx, from, to)) {
                    return false;
                }
                from = to;
                curIdx = cIdx;
            }
        }
        return p.extract(this, curIdx, from, to);
    }
1164116
def get_parallel_value_for_key(self, key):
        
        if self._remotelib:
            return self._remotelib.run_keyword('get_parallel_value_for_key',
                                               [key], {})
        return _PabotLib.get_parallel_value_for_key(self, key)
230372
public static Map<String, Object> keyValuePairAsMap(String key, Object value) {
    Map<String, Object> paramMap = new HashMap<>();
    paramMap.put(key, value);
    return paramMap;
  }
1030424
public static <K, V> void forEachValue(Map<K, V> map, Procedure<? super V> procedure)
    {
        if (map == null)
        {
            throw new IllegalArgumentException("Cannot perform a forEachValue on null");
        }

        if (MapIterate.notEmpty(map))
        {
            if (map instanceof UnsortedMapIterable)
            {
                ((MapIterable<K, V>) map).forEachValue(procedure);
            }
            else
            {
                IterableIterate.forEach(map.values(), procedure);
            }
        }
    }
115880
public static <T> void forEach(Iterator<T> iterator, Procedure1<? super T> procedure) {
		if (procedure == null)
			throw new NullPointerException("procedure");
		while(iterator.hasNext()) {
			procedure.apply(iterator.next());
		}
	}
763308
public static <T> void forEach(Iterable<T> iterable, Procedure1<? super T> procedure) {
		IteratorExtensions.forEach(iterable.iterator(), procedure);
	}