Home | History | Annotate | Download | only in collect

Lines Matching defs:KEY

86     KEY {
104 return (Function) EntryFunction.KEY;
271 * such as the concurrency level, load factor, key/value reference types,
333 * @param type the key type for this map
667 * key type {@code K}, {@code k.equals(k2)} implies that {@code k2} is also
668 * of type {@code K}. Using a key type for which this may not hold, such as
703 * key type {@code K}, {@code k.equals(k2)} implies that {@code k2} is also of
704 * type {@code K}. Using a key type for which this may not hold, such as
740 * key type {@code K}, {@code k.equals(k2)} implies that {@code k2} is also
741 * of type {@code K}. Using a key type for which this may not hold, such as
784 public boolean containsKey(@Nullable Object key) {
785 return backingSet().contains(key);
789 public V get(@Nullable Object key) {
790 if (Collections2.safeContains(backingSet(), key)) {
792 K k = (K) key;
800 public V remove(@Nullable Object key) {
801 if (backingSet().remove(key)) {
803 K k = (K) key;
835 Entry<K, V> transform(final K key) {
836 return immutableEntry(key, function.apply(key));
928 public V get(@Nullable Object key) {
929 if (Collections2.safeContains(set, key)) {
931 K k = (K) key;
1082 * keys} and whose value for each key was computed by {@code valueFunction}.
1083 * The map's iteration order is the order of the first appearance of each key
1091 * for any key
1102 * keys} and whose value for each key was computed by {@code valueFunction}.
1103 * The map's iteration order is the order of the first appearance of each key
1108 * for any key
1118 K key = keys.next();
1119 builder.put(key, valueFunction.apply(key));
1126 * elements in the given order, and each key is the product of invoking a
1130 * @param keyFunction the function used to produce the key for each value
1134 * key for more than one value in the input collection
1145 * elements in the given order, and each key is the product of invoking a
1149 * @param keyFunction the function used to produce the key for each value
1153 * key for more than one value in the input collection
1177 * @throws ClassCastException if any key in {@code Properties} is not a {@code
1179 * @throws NullPointerException if any key or value in {@code Properties} is
1188 String key = (String) e.nextElement();
1189 builder.put(key, properties.getProperty(key));
1196 * Returns an immutable map entry with the specified key and value. The {@link
1201 * @param key the key to be associated with the returned entry
1206 @Nullable K key, @Nullable V value) {
1207 return new ImmutableEntry<K, V>(key, value);
1434 public V forcePut(K key, V value) {
1591 * entry-transformation logic may depend on the key as well as the value.
1600 * public String transformEntry(String key, Boolean value) {
1601 * return value ? key : "no" + key;
1631 * {@code EntryTransformer} key type {@code K}, {@code k.equals(k2)} implies
1633 * EntryTransformer} key type for which this may not hold, such as {@code
1651 * method's entry-transformation logic may depend on the key as well as the
1661 * public String transformEntry(String key, Boolean value) {
1662 * return value ? key : "yes" + key;
1692 * {@code EntryTransformer} key type {@code K}, {@code k.equals(k2)} implies
1694 * EntryTransformer} key type for which this may not hold, such as {@code
1710 * depend on the key as well as the value.
1720 * public String transformEntry(String key, Boolean value) {
1721 * return value ? key : ("yes" + key);
1751 * {@code EntryTransformer} key type {@code K}, {@code k.equals(k2)} implies
1753 * EntryTransformer} key type for which this may not hold, such as {@code
1773 * A transformation of the value of a key-value pair, using both key and value
1777 * @param <K> the key type of the input and output entries
1784 * Determines an output value based on a key-value pair. This method is
1797 * @throws NullPointerException if the key or value is null and this
1800 V2 transformEntry(@Nullable K key, @Nullable V1 value);
1804 * Views a function as an entry transformer that ignores the entry key.
1811 public V2 transformEntry(K key, V1 value) {
1818 final EntryTransformer<? super K, V1, V2> transformer, final K key) {
1823 return transformer.transformEntry(key, v1);
1892 @Override public boolean containsKey(Object key) {
1893 return fromMap.containsKey(key);
1898 @Override public V2 get(Object key) {
1899 V1 value = fromMap.get(key);
1900 return (value != null || fromMap.containsKey(key))
1901 ? transformer.transformEntry((K) key, value)
1907 @Override public V2 remove(Object key) {
1908 return fromMap.containsKey(key)
1909 ? transformer.transformEntry((K) key, fromMap.remove(key))
1984 @Override public Entry<K, V2> ceilingEntry(K key) {
1985 return transformEntry(fromMap().ceilingEntry(key));
1988 @Override public K ceilingKey(K key) {
1989 return fromMap().ceilingKey(key);
2003 @Override public Entry<K, V2> floorEntry(K key) {
2004 return transformEntry(fromMap().floorEntry(key));
2007 @Override public K floorKey(K key) {
2008 return fromMap().floorKey(key);
2020 @Override public Entry<K, V2> higherEntry(K key) {
2021 return transformEntry(fromMap().higherEntry(key));
2024 @Override public K higherKey(K key) {
2025 return fromMap().higherKey(key);
2032 @Override public Entry<K, V2> lowerEntry(K key) {
2033 return transformEntry(fromMap().lowerEntry(key));
2036 @Override public K lowerKey(K key) {
2037 return fromMap().lowerKey(key);
2097 * other methods are supported by the map and its views. When given a key that
2109 * iterate across every key/value mapping in the underlying map and determine
2140 * other methods are supported by the map and its views. When given a key that
2152 * iterate across every key/value mapping in the underlying map and determine
2177 * other methods are supported by the map and its views. When given a key that
2189 * iterate across every key/value mapping in the underlying map and determine
2214 * bimap and its views. When given a key that doesn't satisfy the predicate, the bimap's {@code
2224 * <p>Many of the filtered bimap's methods, such as {@code size()}, iterate across every key in
2259 * iterate across every key/value mapping in the underlying map and determine
2298 * iterate across every key/value mapping in the underlying map and determine
2334 * iterate across every key/value mapping in the underlying map and determine
2392 * key/value pair that doesn't satisfy the predicate, the map's {@code put()}
2395 * throws an {@link IllegalArgumentException} when the existing key and the
2406 * iterate across every key/value mapping in the underlying map and determine
2434 * key/value pair that doesn't satisfy the predicate, the map's {@code put()}
2437 * throws an {@link IllegalArgumentException} when the existing key and the
2448 * iterate across every key/value mapping in the underlying map and determine
2480 * key/value pair that doesn't satisfy the predicate, the map's {@code put()}
2483 * throws an {@link IllegalArgumentException} when the existing key and the
2494 * iterate across every key/value mapping in the underlying map and determine
2519 * and its views. When given a key/value pair that doesn't satisfy the predicate, the bimap's
2522 * method that throws an {@link IllegalArgumentException} when the existing key and the provided
2532 * key/value mapping in the underlying bimap and determine which satisfy the filter. When a live
2570 boolean apply(@Nullable Object key, @Nullable V value) {
2571 // This method is called only when the key is in the map, implying that
2572 // key is a K.
2574 K k = (K) key;
2578 @Override public V put(K key, V value) {
2579 checkArgument(apply(key, value));
2580 return unfiltered.put(key, value);
2590 @Override public boolean containsKey(Object key) {
2591 return unfiltered.containsKey(key) && apply(key, unfiltered.get(key));
2594 @Override public V get(Object key) {
2595 V value = unfiltered.get(key);
2596 return ((value != null) && apply(key, value)) ? value : null;
2603 key) {
2604 return containsKey(key) ? unfiltered.remove(key) : null;
2672 // The cast is called only when the key is in the unfiltered map, implying
2673 // that key is a K.
2676 public boolean containsKey(Object key) {
2677 return unfiltered.containsKey(key) && keyPredicate.apply((K) key);
2847 K key = headMap.lastKey();
2848 if (apply(key, unfiltered.get(key))) {
2849 return key;
2851 headMap = sortedMap().headMap(key);
2951 public V get(@Nullable Object key) {
2952 return filteredDelegate.get(key);
2956 public boolean containsKey(@Nullable Object key) {
2957 return filteredDelegate.containsKey(key);
2961 public V put(K key, V value) {
2962 return filteredDelegate.put(key, value);
2966 public V remove(@Nullable Object key) {
2967 return filteredDelegate.remove(key);
3062 public V forcePut(@Nullable K key, @Nullable V value) {
3063 checkArgument(apply(key, value));
3064 return unfiltered().forcePut(key, value);
3125 public Entry<K, V> lowerEntry(K key) {
3126 return unmodifiableOrNull(delegate.lowerEntry(key));
3130 public K lowerKey(K key) {
3131 return delegate.lowerKey(key);
3135 public Entry<K, V> floorEntry(K key) {
3136 return unmodifiableOrNull(delegate.floorEntry(key));
3140 public K floorKey(K key) {
3141 return delegate.floorKey(key);
3145 public Entry<K, V> ceilingEntry(K key) {
3146 return unmodifiableOrNull(delegate.ceilingEntry(key));
3150 public K ceilingKey(K key) {
3151 return delegate.ceilingKey(key);
3155 public Entry<K, V> higherEntry(K key) {
3156 return unmodifiableOrNull(delegate.higherEntry(key));
3160 public K higherKey(K key) {
3161 return delegate.higherKey(key);
3304 * isEmpty()} methods of its key set and value collection to this
3350 static <V> V safeGet(Map<?, V> map, @Nullable Object key) {
3353 return map.get(key);
3365 static boolean safeContainsKey(Map<?, ?> map, Object key) {
3368 return map.containsKey(key);
3380 static <V> V safeRemove(Map<?, V> map, Object key) {
3383 return map.remove(key);
3394 static boolean containsKeyImpl(Map<?, ?> map, @Nullable Object key) {
3395 return Iterators.contains(keyIterator(map.entrySet().iterator()), key);
3747 Object key = entry.getKey();
3748 key);
3750 && (value != null || map().containsKey(key));
3836 public Entry<K, V> lowerEntry(K key) {
3837 return forward().higherEntry(key);
3841 public K lowerKey(K key) {
3842 return forward().higherKey(key);
3846 public Entry<K, V> floorEntry(K key) {
3847 return forward().ceilingEntry(key);
3851 public K floorKey(K key) {
3852 return forward().ceilingKey(key);
3856 public Entry<K, V> ceilingEntry(K key) {
3857 return forward().floorEntry(key);
3861 public K ceilingKey(K key) {
3862 return forward().floorKey(key);
3866 public Entry<K, V> higherEntry(K key) {
3867 return forward().lowerEntry(key);
3871 public K higherKey(K key) {
3872 return forward().lowerKey(key);