Map instances (including instances of SortedMap, BiMap, etc.). Also see this class's counterparts Lists, Sets
and Queues.
See the Guava User Guide article on Maps.
| Modifier and Type | Class and Description |
|---|---|
| private abstract static class | |
| private static class | |
| private static class | |
| pack-priv abstract static class | |
| private static enum | |
| pack-priv abstract static class | |
| public static interface | Maps.
the key type of the input and output entries K extends @Nullable Object, the value type of the input entry V1 extends @Nullable Object, the value type of the output entry V2 extends @Nullable Object>A transformation of the value of a key-value pair, using both key and value as inputs. |
| pack-priv static class | |
| pack-priv static class | |
| private static class | |
| private static class | |
| private static class | |
| private static class | |
| pack-priv abstract static class | |
| pack-priv static class | |
| pack-priv static class | |
| private static class | |
| pack-priv static class | |
| private static class | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| private static class | |
| pack-priv static class | |
| private static class | |
| pack-priv static class | Maps.
The implementation of |
| pack-priv static class | Maps.
The implementation of |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv abstract static class | Maps.
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <A, B> Converter | asConverter(final BiMap<A, B> bimap)
Returns a |
| pack-priv static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> Function | asEntryToEntryFunction(final Maps.
Views an entry transformer as a function from entries to entries. |
| pack-priv static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> Function | asEntryToValueFunction(final Maps.
Views an entry transformer as a function from |
| pack-priv static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> Maps. | asEntryTransformer(final Function<? super V1, V2> function)
Views a function as an entry transformer that ignores the entry key. |
| public static <K extends @Nullable Object, V extends @Nullable Object> Map | |
| public static <K extends @Nullable Object, V extends @Nullable Object> SortedMap | |
| public static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap | asMap(NavigableSet<K> set, Function<? super K, V> function)
Returns a view of the navigable set as a map, mapping keys from the set according to the specified function. |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> Iterator | |
| pack-priv static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> Function | |
| pack-priv static int | capacity(int expectedSize)
Returns a capacity that is sufficient to keep the map from being resized as long as it grows no larger than expectedSize and the load factor is ≥ its default (0.75). |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> boolean | Returns: true if c contains othe delegate (unwrapped) collection of map entries c,the object that might be contained in o)cImplements |
| pack-priv static boolean | containsKeyImpl(Map<?, ?> map, Object key)
An admittedly inefficient implementation of |
| pack-priv static boolean | |
| public static <K extends @Nullable Object, V extends @Nullable Object> MapDifference | Returns: the difference between the two mapsthe map to treat as the "left" map for purposes of comparison left, Map<? extends K, ? extends V> the map to treat as the "right" map for purposes of comparison right)Computes the difference between two maps. |
| public static <K extends @Nullable Object, V extends @Nullable Object> MapDifference | Returns: the difference between the two mapsthe map to treat as the "left" map for purposes of comparison left, Map<? extends K, ? extends V> the map to treat as the "right" map for purposes of comparison right, Equivalence<? super @NonNull V> the equivalence relationship to use to compare values valueEquivalence)Computes the difference between two maps. |
| public static <K extends @Nullable Object, V extends @Nullable Object> SortedMapDifference | Returns: the difference between the two mapsthe map to treat as the "left" map for purposes of comparison left, Map<? extends K, ? extends V> the map to treat as the "right" map for purposes of comparison right)Computes the difference between two sorted maps, using the comparator of the left map, or
|
| private static <K extends @Nullable Object, V extends @Nullable Object> void | doDifference(Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right, Equivalence<? super @NonNull V> valueEquivalence, Map<K, V> onlyOnLeft, Map<K, V> onlyOnRight, Map<K, V> onBoth, Map<K, MapDifference.
|
| pack-priv static boolean | |
| public static <K extends @Nullable Object, V extends @Nullable Object> Map | filterEntries(Map<K, V> unfiltered, Predicate<? super Map.
Returns a map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> SortedMap | filterEntries(SortedMap<K, V> unfiltered, Predicate<? super Map.
Returns a sorted map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap | filterEntries(NavigableMap<K, V> unfiltered, Predicate<? super Map.
Returns a sorted map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> BiMap | filterEntries(BiMap<K, V> unfiltered, Predicate<? super Map.
Returns a bimap containing the mappings in |
| private static <K extends @Nullable Object, V extends @Nullable Object> Map | filterFiltered(Maps.
Support |
| private static <K extends @Nullable Object, V extends @Nullable Object> SortedMap | filterFiltered(Maps.
Support |
| private static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap | filterFiltered(Maps.
Support |
| private static <K extends @Nullable Object, V extends @Nullable Object> BiMap | filterFiltered(Maps.
Support |
| public static <K extends @Nullable Object, V extends @Nullable Object> Map | filterKeys(Map<K, V> unfiltered, final Predicate<? super K> keyPredicate)
Returns a map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> SortedMap | filterKeys(SortedMap<K, V> unfiltered, final Predicate<? super K> keyPredicate)
Returns a sorted map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap | filterKeys(NavigableMap<K, V> unfiltered, final Predicate<? super K> keyPredicate)
Returns a navigable map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> BiMap | filterKeys(BiMap<K, V> unfiltered, final Predicate<? super K> keyPredicate)
Returns a bimap containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> Map | filterValues(Map<K, V> unfiltered, final Predicate<? super V> valuePredicate)
Returns a map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> SortedMap | filterValues(SortedMap<K, V> unfiltered, final Predicate<? super V> valuePredicate)
Returns a sorted map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap | filterValues(NavigableMap<K, V> unfiltered, final Predicate<? super V> valuePredicate)
Returns a navigable map containing the mappings in |
| public static <K extends @Nullable Object, V extends @Nullable Object> BiMap | filterValues(BiMap<K, V> unfiltered, final Predicate<? super V> valuePredicate)
Returns a bimap containing the mappings in |
| public static ImmutableMap | Returns: an immutable map containing all the entries inpropertiesa properties)Properties object to be convertedCreates an |
| public static <K extends @Nullable Object, V extends @Nullable Object> Map. | immutableEntry(K
the key to be associated with the returned entry key, V the value to be associated with the returned entry value)Returns an immutable map entry with the specified key and value. |
| public static <K extends Enum | Returns: an immutable map containing those entriesthe map to make an immutable copy of map)Returns an immutable map instance containing the given entries. |
| pack-priv static <E> ImmutableMap | |
| pack-priv static <K extends @Nullable Object> Function | |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> Iterator | |
| pack-priv static <K extends @Nullable Object> K | |
| pack-priv static <K extends @Nullable Object> Predicate | |
| public static <K, V> ConcurrentMap | |
| public static <K extends Enum | Returns: a new, emptyEnumMapthe key type for this map type)Creates an |
| public static <K extends Enum | Returns: a newEnumMap initialized with the mappings from mapthe map from which to initialize this map)EnumMapCreates an |
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMap | |
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMap | Returns: a newHashMap initialized with the mappings from mapthe mappings to be placed in the new map map)Creates a mutable |
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMap | Returns: a new, emptyHashMap with enough capacity to hold expectedSize entries
without resizingthe number of entries you expect to add to the returned map expectedSize)Creates a |
| public static <K extends @Nullable Object, V extends @Nullable Object> IdentityHashMap | |
| public static <K extends @Nullable Object, V extends @Nullable Object> LinkedHashMap | Returns: a new, emptyLinkedHashMapCreates a mutable, empty, insertion-ordered |
| public static <K extends @Nullable Object, V extends @Nullable Object> LinkedHashMap | Returns: a new,LinkedHashMap initialized with the mappings from mapthe mappings to be placed in the new map map)Creates a mutable, insertion-ordered |
| public static <K extends @Nullable Object, V extends @Nullable Object> LinkedHashMap | Returns: a new, emptyLinkedHashMap with enough capacity to hold expectedSize
entries without resizingthe number of entries you expect to add to the returned map expectedSize)Creates a |
| public static <K extends Comparable | Returns: a new, emptyTreeMapCreates a mutable, empty |
| public static <K extends @Nullable Object, V extends @Nullable Object> TreeMap | Returns: a newTreeMap initialized with the mappings from map and using the
comparator of mapthe sorted map whose mappings are to be placed in the new map and whose comparator
is to be used to sort the new map map)Creates a mutable |
| public static <C extends @Nullable Object, K extends C, V extends @Nullable Object> TreeMap | Returns: a new, emptyTreeMapthe comparator to sort the keys with comparator)Creates a mutable, empty |
| pack-priv static <E extends @Nullable Object> Comparator | orNaturalOrder(Comparator<? super E> comparator)
Returns the specified comparator if not null; otherwise returns |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> void | |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> boolean | Returns: true if c was changedthe delegate (unwrapped) collection of map entries c,the object to remove from o)cImplements |
| private static <E extends @Nullable Object> NavigableSet | |
| private static <E extends @Nullable Object> Set | |
| private static <E extends @Nullable Object> SortedSet | |
| pack-priv static boolean | |
| pack-priv static <V extends @Nullable Object> V | |
| pack-priv static <V extends @Nullable Object> V | |
| public static <K extends Comparable | subMap(NavigableMap<K, V> map, Range<K> range)
Returns a view of the portion of |
| public static <K extends @Nullable Object, V extends @Nullable Object> BiMap | Returns: a synchronized view of the specified bimapthe bimap to be wrapped in a synchronized view bimap)Returns a synchronized (thread-safe) bimap backed by the specified bimap. |
| public static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap | Returns: a synchronized view of the specified navigable map.the navigable map to be "wrapped" in a synchronized navigable map. navigableMap)Returns a synchronized (thread-safe) navigable map backed by the specified navigable map. |
| public static <T extends @Nullable Object, K extends Enum | toImmutableEnumMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)
Returns a |
| public static <T extends @Nullable Object, K extends Enum | toImmutableEnumMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction, BinaryOperator<V> mergeFunction)
Returns a |
| public static <K, V> ImmutableMap | |
| public static <K, V> ImmutableMap | |
| pack-priv static String | |
| public static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> Map | transformEntries(Map<K, V1> fromMap, Maps.
Returns a view of a map whose values are derived from the original map's entries. |
| public static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> SortedMap | transformEntries(SortedMap<K, V1> fromMap, Maps.
Returns a view of a sorted map whose values are derived from the original sorted map's entries. |
| public static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> NavigableMap | transformEntries(NavigableMap<K, V1> fromMap, Maps.
Returns a view of a navigable map whose values are derived from the original navigable map's entries. |
| pack-priv static <V2 extends @Nullable Object, K extends @Nullable Object, V1 extends @Nullable Object> Map. | transformEntry(final Maps.
Returns a view of an entry transformed by the specified transformer. |
| public static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> Map | transformValues(Map<K, V1> fromMap, Function<? super V1, V2> function)
Returns a view of a map where each value is transformed by a function. |
| public static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> SortedMap | transformValues(SortedMap<K, V1> fromMap, Function<? super V1, V2> function)
Returns a view of a sorted map where each value is transformed by a function. |
| public static <K extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> NavigableMap | transformValues(NavigableMap<K, V1> fromMap, Function<? super V1, V2> function)
Returns a view of a navigable map where each value is transformed by a function. |
| public static <K, V> ImmutableMap | Returns: a map mapping the result of evaluating the functionkeyFunction on each value
in the input collection to that valuethe values to use when constructing the values, Function<? super V, K> Mapthe function used to produce the key for each value keyFunction)Returns a map with the given |
| public static <K, V> ImmutableMap | Returns: a map mapping the result of evaluating the functionkeyFunction on each value
in the input collection to that valuethe values to use when constructing the values, Function<? super V, K> Mapthe function used to produce the key for each value keyFunction)Returns a map with the given |
| private static <K, V> ImmutableMap | uniqueIndex(Iterator<V> values, Function<? super V, K> keyFunction, ImmutableMap.
|
| public static <K extends @Nullable Object, V extends @Nullable Object> BiMap | Returns: an unmodifiable view of the specified bimapthe bimap for which an unmodifiable view is to be returned bimap)Returns an unmodifiable view of the specified bimap. |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> Map. | Returns: an unmodifiable view of the entrythe entry for which to return an unmodifiable view entryReturns an unmodifiable view of the specified map entry. |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> UnmodifiableIterator | |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> Set | Returns: an unmodifiable view of the entriesthe entries for which to return an unmodifiable view entrySetReturns an unmodifiable view of the specified set of entries. |
| private static <K extends @Nullable Object, V extends @Nullable Object> Map | |
| public static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap | Returns: an unmodifiable view of the specified navigable mapthe navigable map for which an unmodifiable view is to be returned map)Returns an unmodifiable view of the specified navigable map. |
| private static <K extends @Nullable Object, V extends @Nullable Object> Map. | |
| pack-priv static <V extends @Nullable Object> Function | |
| pack-priv static <K extends @Nullable Object, V extends @Nullable Object> Iterator | |
| pack-priv static <V extends @Nullable Object> V | |
| pack-priv static <V extends @Nullable Object> Predicate |