IDictionary<TKey, TValue>
A dictionary is a natural extension of a set. While a set contains elements (keys) and nothing else, a dictionary stores keys associated with values. As with the set, a dictionary can store a specific key only once.
You are probably already familiar with dictionaries as the standard Delphi implementation has been with us for quite a long time. It is no wonder that the Spring interface, IDictionary<TKey, TValue>
, closely mirrors the Delphi version, as shown here in a slightly shortened form:
IDictionary<TKey, TValue> = interface(IMap<TKey, TValue>) procedure AddOrSetValue(const key: TKey; const value: TValue); deprecated 'Use dict[key] := value instead'; function Extract(const key: TKey): TValue; function GetValueOrDefault(const key: TKey): TValue; function GetValueOrDefault(const key: TKey; const defaultValue: TValue): TValue...