Lines Matching defs:map

46     /// Representation of a map field in a Protocol Buffer message.

48 /// <typeparam name="TKey">Key type in the map. Must be a type supported by Protocol Buffer map keys.</typeparam>
49 /// <typeparam name="TValue">Value type in the map. Must be a type supported by Protocol Buffers.</typeparam>
55 /// Null values are not permitted in the map, either for wrapper types or regular messages.
56 /// If a map is deserialized from a data stream and the value is missing from an entry, a default value
58 /// on); for message types, an empty instance of the message is created, as if the map entry contained a 0-length
79 // TODO: Don't create the map/list until we have an entry. (Assume many maps will be empty.)
80 private readonly Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>> map =
110 /// Adds the specified key/value pair to the map.
113 /// This operation fails if the key already exists in the map. To replace an existing entry, use the indexer.
117 /// <exception cref="System.ArgumentException">The given key already exists in map.</exception>
123 throw new ArgumentException("Key already exists in map", nameof(key));
129 /// Determines whether the specified key is present in the map.
132 /// <returns><c>true</c> if the map contains the given key; <c>false</c> otherwise.</returns>
136 return map.ContainsKey(key);
143 /// Removes the entry identified by the given key from the map.
145 /// <param name="key">The key indicating the entry to remove from the map.</param>
146 /// <returns><c>true</c> if the map contained the given key before the entry was removed; <c>false</c> otherwise.</returns>
151 if (map.TryGetValue(key, out node))
153 map.Remove(key);
170 /// <returns><c>true</c> if the map contains an element with the specified key; otherwise, <c>false</c>.</returns>
174 if (map.TryGetValue(key, out node))
215 if (map.TryGetValue(key, out node))
222 map[key] = node;
228 /// Gets a collection containing the keys in the map.
233 /// Gets a collection containing the values in the map.
238 /// Adds the specified entries to the map. The keys and values are not automatically cloned.
240 /// <param name="entries">The entries to add to the map.</param>
273 /// Adds the specified item to the map.
275 /// <param name="item">The item to add to the map.</param>
282 /// Removes all items from the map.
287 map.Clear();
291 /// Determines whether map contains an entry equivalent to the given key/value pair.
302 /// Copies the key/value pairs in this map to an array.
312 /// Removes the specified key/value pair from the map.
324 if (map.TryGetValue(item.Key, out node) &&
327 map.Remove(item.Key);
338 /// Gets the number of elements contained in the map.
343 /// Gets a value indicating whether the map is read-only.
378 /// Compares this map with another for equality.
383 /// <param name="other">The map to compare this with.</param>
384 /// <returns><c>true</c> if <paramref name="other"/> refers to an equal map; <c>false</c> otherwise.</returns>
416 /// Adds entries to the map from the given stream.
439 /// Adds entries to the map from the given parse context.
461 /// Writes the contents of this map to the given coded output stream, using the specified codec
480 /// Writes the contents of this map to the given write context, using the specified codec
499 /// Calculates the size of this map based on the given entry codec.
634 /// A codec for a specific map field. This contains all the information required to encode and
645 /// and the tag to use for each map entry.
649 /// <param name="mapTag">The map tag to use to introduce each map entry.</param>
658 /// The tag used in the enclosing message to indicate map entries.
714 // Corner case: a map entry with a key but no value, where the value type is a message.