Represents a generic collection of key/value pairs.
Public Aliases | |
| using | key_type |
| Represents the dictionary key type. | |
| using | mapped_type |
| Represents the dictionary mapped type. | |
| using | value_type |
| Represents the xtd::collections::generic::idictionary value type. | |
| using | iterator |
| Represents the iterator of xtd::collections::generic::ienumerable value type. | |
| using | const_iterator |
| Represents the const iterator of xtd::collections::generic::ienumerable value type. | |
| using | key_collection |
| Represents the idictionary key collection type. | |
| using | value_collection |
| Represents the idictionary value collection type. | |
Public Properties | |
| virtual auto | keys () const noexcept -> key_collection=0 |
| Gets an xtd::collections::generic::icollection <type_t> containing the keys of the xtd::collections::generic::idictionary <key_t, value_t>. | |
| virtual auto | values () const noexcept -> value_collection=0 |
| Gets an xtd::collections::generic::icollection <type_t> containing the values of the xtd::collections::generic::idictionary <key_t, value_t>. | |
Public Methods | |
| virtual auto | add (const key_t &key, const value_t &value) -> void=0 |
| Adds an element with the provided key and value to the xtd::collections::generic::idictionary <key_t, value_t>. | |
| virtual auto | contains_key (const key_t &key) const noexcept -> bool=0 |
| Determines whether the xtd::collections::generic::idictionary <key_t, value_t> contains an element with the specified key. | |
| virtual auto | remove (const key_t &key) noexcept -> bool=0 |
| Removes the element with the specified key from the xtd::collections::generic::idictionary <key_t, value_t>. | |
| virtual auto | try_get_value (const key_t &key, value_t &value) const -> bool=0 |
| Gets the value associated with the specified key. | |
Public Operators | |
| virtual auto | operator[] (const key_t &key) -> value_t &=0 |
| Gets the element with the specified key. | |
| using xtd::collections::generic::idictionary< key_t, value_t >::key_type |
Represents the dictionary key type.
| using xtd::collections::generic::idictionary< key_t, value_t >::mapped_type |
Represents the dictionary mapped type.
| using xtd::collections::generic::idictionary< key_t, value_t >::value_type |
Represents the xtd::collections::generic::idictionary value type.
| using xtd::collections::generic::idictionary< key_t, value_t >::iterator |
Represents the iterator of xtd::collections::generic::ienumerable value type.
| using xtd::collections::generic::idictionary< key_t, value_t >::const_iterator |
Represents the const iterator of xtd::collections::generic::ienumerable value type.
| using xtd::collections::generic::idictionary< key_t, value_t >::key_collection |
Represents the idictionary key collection type.
| using xtd::collections::generic::idictionary< key_t, value_t >::value_collection |
Represents the idictionary value collection type.
|
nodiscardpure virtualnoexcept |
Gets an xtd::collections::generic::icollection <type_t> containing the keys of the xtd::collections::generic::idictionary <key_t, value_t>.
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< key_type, mapped_type >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::dictionary< xtd::string, xtd::any_object >, xtd::collections::generic::dictionary< xtd::string, xtd::string >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, and xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >.
|
nodiscardpure virtualnoexcept |
Gets an xtd::collections::generic::icollection <type_t> containing the values of the xtd::collections::generic::idictionary <key_t, value_t>.
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< key_type, mapped_type >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::dictionary< xtd::string, xtd::any_object >, xtd::collections::generic::dictionary< xtd::string, xtd::string >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, and xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >.
|
pure virtual |
Adds an element with the provided key and value to the xtd::collections::generic::idictionary <key_t, value_t>.
| key | The object to use as the key of the element to add. |
| value | The object to use as the value of the element to add. |
| xtd::argument_exception | An element with the same key already exists in the xtd::collections::generic::idictionary <key_t, value_t>. |
| xtd::not_supported_exception | The xtd::collections::generic::idictionary <key_t, value_t> is read-only. |
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, and xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >.
|
nodiscardpure virtualnoexcept |
Determines whether the xtd::collections::generic::idictionary <key_t, value_t> contains an element with the specified key.
| key | The key to locate in the xtd::collections::generic::idictionary <key_t, value_t>. |
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, and xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >.
|
pure virtualnoexcept |
Removes the element with the specified key from the xtd::collections::generic::idictionary <key_t, value_t>.
| key | The key of the element to remove. |
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, and xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >.
|
nodiscardpure virtual |
Gets the value associated with the specified key.
| key | The key whose value to get. |
| value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. |
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, and xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >.
|
nodiscardpure virtual |
Gets the element with the specified key.
| key | The key of the element to get. |
| xtd::collections::generic::key_not_found_exception | The property is retrieved and key is not found. |
| xtd::not_supported_exception | The property is set and the xtd::collections::generic::idictionary <key_t, value_t> is read-only. |
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, and xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >.