Iterate methods.
Iterate
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <K, V> Collection | addAllKeysTo(Map<K, V> map, Collection<K> targetCollection)
Adds all the keys from map to the specified targetCollection. |
| public static <K, V> Collection | addAllValuesTo(Map<K, V> map, Collection<V> targetCollection)
Adds all the values from map to the specified targetCollection. |
| public static <K, V> boolean | |
| public static <K, V> boolean | |
| public static <K, V, A> MutableList | |
| public static <K, V, K2, V2> MutableMap | |
| public static <K1, V1, K2, V2, R extends Map | |
| public static <K1, V1, K2, V2> MutableMap | |
| public static <K1, V1, K2, V2> MutableMap | |
| public static <K, V, A, R extends Collection | |
| public static <K, V> MutableBooleanCollection | |
| public static <K, V, R extends MutableBooleanCollection> R | |
| public static <K, V> MutableByteCollection | |
| public static <K, V, R extends MutableByteCollection> R | |
| public static <K, V> MutableCharCollection | |
| public static <K, V, R extends MutableCharCollection> R | |
| public static <K, V> MutableDoubleCollection | |
| public static <K, V, R extends MutableDoubleCollection> R | |
| public static <K, V> MutableFloatCollection | |
| public static <K, V, R extends MutableFloatCollection> R | |
| public static <K1, V1, K2, V2> MutableMap | collectIf(Map<K1, V1> map, Function2<? super K1, ? super V1, Pair<K2, V2>> function, Predicate2<? super K1, ? super V1> predicate)
For each value of the map, the Predicate2 is evaluated with the key and value as the parameter,
and if true, then |
| public static <K1, V1, K2, V2> MutableMap | |
| public static <K, V> MutableIntCollection | |
| public static <K, V, R extends MutableIntCollection> R | |
| public static <K, V, K2, R extends Map | |
| public static <K, V> MutableLongCollection | |
| public static <K, V, R extends MutableLongCollection> R | |
| public static <K, V> MutableShortCollection | |
| public static <K, V, R extends MutableShortCollection> R | |
| public static <K, V, V2> MutableMap | collectValues(Map<K, V> map, Function2<? super K, ? super V, ? extends V2> function)
For each key and value of the map, the function is evaluated with the key and value as the parameter. |
| public static <K, V, V2, R extends Map | collectValues(Map<K, V> map, Function2<? super K, ? super V, ? extends V2> function, R target)
For each key and value of the map, the function is evaluated with the key and value as the parameter. |
| public static <K, V> int | |
| public static <K, V> Pair | |
| public static <K, V> V | |
| public static <K, V> V | |
| public static <K, V> Optional | |
| public static <K, V> Optional | |
| public static <K, V> MutableSetMultimap | |
| public static <K, V> MutableSortedSetMultimap | |
| public static <K, V> MutableMap | |
| public static <K, V> void | forEachKey(Map<K, V> map, Procedure<? super K> procedure)
For each key of the map, |
| public static <K, V> void | forEachKeyValue(Map<K, V> map, Procedure2<? super K, ? super V> procedure)
For each entry of the map, |
| public static <K, V> void | forEachValue(Map<K, V> map, Procedure<? super V> procedure)
For each value of the map, |
| public static <K, V> V | getIfAbsent(Map<K, V> map, K key, Function0<? extends V> instanceBlock)
Get and return the value in the Map that corresponds to the specified key, or if there is no value
at the key, return the result of evaluating the specified |
| public static <K, V> V | getIfAbsentDefault(Map<K, V> map, K key, V defaultValue)
Get and return the value in the Map at the specified key, or if there is no value at the key, return the
|
| public static <K, V> V | getIfAbsentPut(Map<K, V> map, K key, Function0<? extends V> instanceBlock)
Get and return the value in the Map at the specified key, or if there is no value at the key, return the result
of evaluating the specified |
| public static <K, V, P> V | getIfAbsentPutWith(Map<K, V> map, K key, Function<? super P, ? extends V> function, P parameter)
Get and return the value in the Map at the specified key, or if there is no value at the key, return the result
of evaluating the specified |
| public static <K, V, P> V | getIfAbsentWith(Map<K, V> map, K key, Function<? super P, ? extends V> function, P parameter)
Get and return the value in the Map that corresponds to the specified key, or if there is no value
at the key, return the result of evaluating the specified |
| public static <K, V, A> A | ifPresentApply(Map<K, V> map, K key, Function<? super V, ? extends A> function)
If there is a value in the Map that the specified key, return the result of applying the specified Function on the value, otherwise return null. |
| public static <K, V, IV> IV | |
| public static <IV, K, V> IV | injectIntoIf(IV initialValue, Map<K, V> map, Predicate<? super V> predicate, Function2<? super IV, ? super V, ? extends IV> function)
Same as |
| private static <K, V> boolean | |
| public static boolean | |
| public static <K, V> boolean | |
| public static boolean | |
| public static <K, V> int | occurrencesOf(Map<K, V> map, V object)
Return the number of occurrences of object in the specified map. |
| public static <K, V, A> int | occurrencesOfAttribute(Map<K, V> map, Function<? super V, ? extends A> function, A object)
Return the number of occurrences where object is equal to the specified attribute in the specified map. |
| public static <K, V> MutableList | |
| public static <K, V, R extends Collection | |
| public static <K, V> MutableMap | rejectMapOnEntry(Map<K, V> map, Predicate2<? super K, ? super V> predicate)
For each value of the map, predicate is evaluated with the element as the parameter. |
| public static <K, V, R extends Map | rejectMapOnEntry(Map<K, V> map, Predicate2<? super K, ? super V> predicate, R target)
For each value of the map, predicate is evaluated with the element as the parameter. |
| public static <K, V> MutableMap | |
| public static <K, V> MutableList | |
| public static <K, V, R extends Collection | |
| public static <K, V> MutableMap | selectMapOnEntry(Map<K, V> map, Predicate2<? super K, ? super V> predicate)
For each entry of the source map, the Predicate2 is evaluated. |
| public static <K, V, R extends Map | selectMapOnEntry(Map<K, V> map, Predicate2<? super K, ? super V> predicate, R target)
For each entry of the source map, the Predicate2 is evaluated. |
| public static <K, V> MutableMap | selectMapOnKey(Map<K, V> map, Predicate<? super K> predicate)
For each key of the source map, the Predicate is evaluated. |
| public static <K, V> MutableMap | selectMapOnValue(Map<K, V> map, Predicate<? super V> predicate)
For each value of the source map, the Predicate is evaluated. |
| public static <K, V> MutableList | toListOfPairs(Map<K, V> map)
Iterate over the specified map applying the specified Function to each value and return the results as a List. |
| public static <K, V> MutableList | toSortedList(Map<K, V> map, Comparator<? super V> comparator)
Iterate over the specified map applying the specified Function to each value and return the results as a sorted List using the specified Comparator. |