Lines Matching defs:Map

51 import java.util.Map;
52 import java.util.Map.Entry;
62 * Static utility methods pertaining to {@link Map} instances (including instances of
144 Map<K, ? extends V> map) {
152 for (Map.Entry<K, ? extends V> entry : map.entrySet()) {
214 * ImmutableMap#copyOf(Map)} instead.
224 Map<? extends K, ? extends V> map) {
246 * ImmutableMap#copyOf(Map)} instead.
253 Map<? extends K, ? extends V> map) {
321 // Map<Class<? extends Throwable>, String> map = newTreeMap(comparator);
345 Map<K, ? extends V> map) {
376 Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right) {
406 Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right,
410 Map<K, V> onlyOnLeft = newHashMap();
411 Map<K, V> onlyOnRight = new HashMap<K, V>(right); // will whittle it down
412 Map<K, V> onBoth = newHashMap();
413 Map<K, MapDifference.ValueDifference<V>> differences = newHashMap();
419 Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right,
421 Map<K, V> onlyOnLeft, Map<K, V> onlyOnRight, Map<K, V> onBoth,
422 Map<K, MapDifference.ValueDifference<V>> differences) {
440 private static <K, V> Map<K, V> unmodifiableMap(Map<K, V> map) {
449 final Map<K, V> onlyOnLeft;
450 final Map<K, V> onlyOnRight;
451 final Map<K, V> onBoth;
452 final Map<K, ValueDifference<V>> differences;
454 MapDifferenceImpl(Map<K, V> onlyOnLeft,
455 Map<K, V> onlyOnRight, Map<K, V> onBoth,
456 Map<K, ValueDifference<V>> differences) {
469 public Map<K, V> entriesOnlyOnLeft() {
474 public Map<K, V> entriesOnlyOnRight() {
479 public Map<K, V> entriesInCommon() {
484 public Map<K, ValueDifference<V>> entriesDiffering() {
589 SortedMap<K, ? extends V> left, Map<? extends K, ? extends V> right) {
643 * Returns a live {@link Map} view whose keys are the contents of {@code set}
670 public static <K, V> Map<K, V> asMap(
781 Map<K, V> map() {
940 Map<K, V> builder = newLinkedHashMap();
949 * Returns an immutable map for which the {@link Map#values} are the given
953 * @param values the values to use when constructing the {@code Map}
968 * Returns an immutable map for which the {@link Map#values} are the given
972 * @param values the values to use when constructing the {@code Map}
1105 * <p>To use a plain {@link Map} as a {@link Function}, see
1106 * {@link com.google.common.base.Functions#forMap(Map)} or
1107 * {@link com.google.common.base.Functions#forMap(Map, Object)}.
1215 final Map<K, V> unmodifiableMap;
1227 @Override protected Map<K, V> delegate() {
1259 * Map<String, Integer> map = ImmutableMap.of("a", 4, "b", 9);
1266 * Map<String, Double> transformed = Maps.transformValues(map, sqrt);
1285 * applied many times for bulk operations like {@link Map#containsValue} and
1286 * {@code Map.toString()}. For this to perform well, {@code function} should
1290 public static <K, V1, V2> Map<K, V2> transformValues(
1291 Map<K, V1> fromMap, Function<? super V1, V2> function) {
1327 * applied many times for bulk operations like {@link Map#containsValue} and
1328 * {@code Map.toString()}. For this to perform well, {@code function} should
1347 * Map<String, Boolean> options =
1355 * Map<String, String> transformed =
1376 * Map#containsValue} and {@link Object#toString}. For this to perform well,
1390 public static <K, V1, V2> Map<K, V2> transformEntries(
1391 Map<K, V1> fromMap,
1408 * Map<String, Boolean> options =
1437 * Map#containsValue} and {@link Object#toString}. For this to perform well,
1466 * {@link Maps#transformEntries(Map, EntryTransformer)}.
1569 final Map<K, V1> fromMap;
1573 Map<K, V1> fromMap,
1615 @Override Map<K, V2> map() {
1701 public static <K, V> Map<K, V> filterKeys(
1702 Map<K, V> unfiltered, final Predicate<? super K> keyPredicate) {
1813 public static <K, V> Map<K, V> filterValues(
1814 Map<K, V> unfiltered, final Predicate<? super V> valuePredicate) {
1921 public static <K, V> Map<K, V> filterEntries(
1922 Map<K, V> unfiltered, Predicate<? super Entry<K, V>> entryPredicate) {
2020 private static <K, V> Map<K, V> filterFiltered(AbstractFilteredMap<K, V> map,
2028 final Map<K, V> unfiltered;
2032 Map<K, V> unfiltered, Predicate<? super Entry<K, V>> predicate) {
2050 @Override public void putAll(Map<? extends K, ? extends V> map) {
2081 Map<K, V> unfiltered;
2084 FilteredMapValues(Map<K, V> filteredMap, Map<K, V> unfiltered,
2123 FilteredKeyMap(Map<K, V> unfiltered, Predicate<? super K> keyPredicate,
2156 Map<K, V> unfiltered, Predicate<? super Entry<K, V>> entryPredicate) {
2448 * Delegates to {@link Map#get}. Returns {@code null} on {@code
2451 static <V> V safeGet(Map<?, V> map, @Nullable Object key) {
2463 * Delegates to {@link Map#containsKey}. Returns {@code false} on {@code
2466 static boolean safeContainsKey(Map<?, ?> map, Object key) {
2478 * Delegates to {@link Map#remove}. Returns {@code null} on {@code
2481 static <V> V safeRemove(Map<?, V> map, Object key) {
2493 * An admittedly inefficient implementation of {@link Map#containsKey}.
2495 static boolean containsKeyImpl(Map<?, ?> map, @Nullable Object key) {
2500 * An implementation of {@link Map#containsValue}.
2502 static boolean containsValueImpl(Map<?, ?> map, @Nullable Object value) {
2508 * map entries. If {@code o} is an instance of {@code Map.Entry}, it is
2528 * map entries. If {@code o} is an instance of {@code Map.Entry}, it is
2547 * An implementation of {@link Map#equals}.
2549 static boolean equalsImpl(Map<?, ?> map, Object object) {
2552 } else if (object instanceof Map) {
2553 Map<?, ?> o = (Map<?, ?>) object;
2563 * An implementation of {@link Map#toString}.
2565 static String toStringImpl(Map<?, ?> map) {
2573 * An implementation of {@link Map#putAll}.
2576 Map<K, V> self, Map<? extends K, ? extends V> map) {
2577 for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
2583 final Map<K, V> map;
2585 KeySet(Map<K, V> map) {
2589 Map<K, V> map() {
2674 final Map<K, V> map;
2676 Values(Map<K, V> map) {
2680 final Map<K, V> map() {
2749 abstract Map<K, V> map();