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 | count () const noexcept -> xtd::usize=0 |
| Gets the number of elements contained in the xtd::collections::generic::icollection <type_t>. | |
| virtual auto | is_read_only () const noexcept -> bool=0 |
| Gets a value indicating whether the xtd::collections::generic::icollection <type_t> is read-only. | |
| virtual auto | is_synchronized () const noexcept -> bool=0 |
| Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is synchronized (thread safe). | |
| 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 | sync_root () const noexcept -> const xtd::object &=0 |
| Gets an object that can be used to synchronize access to the the xtd::collections::generic::icollection <type_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 xtd::collections::generic::key_value_pair< key_t, value_t > &item) -> void=0 |
| Adds an item to the xtd::collections::generic::icollection <type_t>. | |
| 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 | clear () -> void=0 |
| Removes all items from the xtd::collections::generic::icollection <type_t>. | |
| virtual auto | contains (const xtd::collections::generic::key_value_pair< key_t, value_t > &item) const noexcept -> bool=0 |
| Determines whether the xtd::collections::generic::icollection <type_t> contains a specific value. | |
| 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 | copy_to (xtd::array< xtd::collections::generic::key_value_pair< key_t, value_t > > &array, xtd::usize array_index) const -> void=0 |
| Copies the elements of the xtd::collections::generic::icollection <type_t> to an xtd::array, starting at a particular xtd::array index. | |
| virtual auto | get_enumerator () const -> xtd::collections::generic::enumerator< xtd::collections::generic::key_value_pair< key_t, value_t > >=0 |
| Returns an enumerator that iterates through a collection. | |
| virtual auto | remove (const xtd::collections::generic::key_value_pair< key_t, value_t > &item) -> bool=0 |
| Removes the first occurrence of a specific object from the xtd::collections::generic::icollection <type_t>. | |
| 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. | |
Additional Inherited Members | |
| using | value_type |
| Represents the xtd::collections::generic::icollection value type. | |
| using | value_type |
| Represents the xtd::collections::generic::ienumerable 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 | iterator |
| Represents the iterator of enumerable value type. | |
| using | const_iterator |
| Represents the const iterator of enumerable value type. | |
| using | enumerable_type |
| Represents the ienumerable enumerable type. | |
| using | source_type |
| Represents the ienumerable source type. | |
| using | ienumerable |
| Represents the ienumerable value type. | |
| using | list |
| Represents the list value type. | |
| virtual auto | begin () const -> const_iterator |
| Returns an iterator to the first element of the enumerable. | |
| virtual auto | cbegin () const -> const_iterator |
| Returns an iterator to the first element of the enumerable. | |
| virtual auto | cend () const -> const_iterator |
| Returns an iterator to the element following the last element of the enumerable. | |
| virtual auto | end () const -> const_iterator |
| Returns an iterator to the element following the last element of the enumerable. | |
| auto | aggregate (const std::function< xtd::collections::generic::key_value_pair< key_t, value_t >(const xtd::collections::generic::key_value_pair< key_t, value_t > &, const xtd::collections::generic::key_value_pair< key_t, value_t > &)> &funcfunc) const -> xtd::collections::generic::key_value_pair< key_t, value_t > |
| Applies an accumulator function over a sequence. | |
| auto | all (const std::function< bool(const xtd::collections::generic::key_value_pair< key_t, value_t > &)> &predicatepredicate) const -> bool |
| Determines whether all elements of a sequence satisfy a condition. | |
| auto | any () const noexcept -> bool |
| Determines whether a sequence contains any elements. | |
| auto | append (const xtd::collections::generic::key_value_pair< key_t, value_t > &element) const noexcept |
| Appends a value to the end of the sequence. | |
| auto | as_enumerable () const noexcept |
| Returns the input typed as xtd::collections::generic::ienumerable <type_t>. | |
| auto | average () const noexcept |
| Computes the average of a sequence of source_t values. | |
| auto | cast () const noexcept |
| Casts the elements of an xtd::collections::generic::ienumerable to the specified type. | |
| auto | chunk (xtd::usize size) const |
| Splits the elements of a sequence into chunks of size at most size. | |
| auto | concat (const ienumerable< xtd::collections::generic::key_value_pair< key_t, value_t > > &second) const noexcept |
| Concatenates two sequences. | |
| auto | contains (const xtd::collections::generic::key_value_pair< key_t, value_t > &value) const noexcept -> bool |
| Determines whether a sequence contains a specified element by using the default equality comparer. | |
| auto | count () const noexcept -> xtd::usize |
| Returns the number of elements in current sequence. | |
| auto | count_by (const std::function< key_t(const xtd::collections::generic::key_value_pair< key_t, value_t > &)> &key_selector) const noexcept |
| Returns the count of elements in the current sequence grouped by key. | |
| auto | default_if_empty () const noexcept |
| Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the current sequence is empty. | |
| auto | distinct () const noexcept |
| Returns distinct elements from a sequence by using the default equality comparer to compare values. | |
| auto | first_or_default (const std::function< bool(const xtd::collections::generic::key_value_pair< key_t, value_t > &)> &predicatepredicate, const xtd::collections::generic::key_value_pair< key_t, value_t > &default_value) const noexcept -> xtd::collections::generic::key_value_pair< key_t, value_t > |
| Returns the first element of the sequence that satisfies a condition, or a specified default value if no such element is found. | |
| auto | order () const |
| Sorts the elements of a sequence in ascending order. | |
| auto | order_by (const std::function< xtd::collections::generic::key_value_pair< key_t, value_t >(const xtd::collections::generic::key_value_pair< key_t, value_t > &)> &key_selector) const |
| Sorts the elements of a sequence in ascending order according to a key. | |
| auto | order_by_descending (const std::function< key_t(const xtd::collections::generic::key_value_pair< key_t, value_t > &)> &key_selector) const |
| Sorts the elements of a sequence in descending order according to a key. | |
| auto | select (auto &&selector) const |
| Projects each element of a sequence into a new form. | |
| auto | to_array () const noexcept -> xtd::array< xtd::collections::generic::key_value_pair< key_t, value_t > > |
| Creates a xtd::array <type_t> from an xtd::collections::generic::ienumerable <type_t>. | |
| auto | to_list () const noexcept -> xtd::collections::generic::list< xtd::collections::generic::key_value_pair< key_t, value_t > > |
| Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <type_t>. | |
| auto | where (auto &&predicatepredicate) const |
| Filters a sequence of values based on a predicate. | |
| virtual auto | empty () const noexcept -> bool |
| Checks whether the container is empty. | |
| virtual auto | size () const noexcept -> xtd::usize |
| Gets the number of elements contained in the xtd::collections::generic::icollection <type_t>. | |
| virtual auto | operator<< (const xtd::collections::generic::key_value_pair< key_t, value_t > &item) -> icollection< xtd::collections::generic::key_value_pair< key_t, value_t > > & |
| The shift left operator adds an item to the xtd::collections::generic::icollection <type_t>. | |
| virtual auto | operator>> (const xtd::collections::generic::key_value_pair< key_t, value_t > &item) -> icollection< xtd::collections::generic::key_value_pair< key_t, value_t > > & |
| The shift right operator removes the first occurrence of a specific object from the xtd::collections::generic::icollection <type_t>. | |
| static auto | to_const_iterator (typename source_collection_t::const_iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept -> typename target_collection_t::const_iterator |
| Converts source iterator to target iterator. | |
| static auto | to_iterator (typename source_collection_t::const_iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept -> typename target_collection_t::const_iterator |
| Converts source iterator to target iterator. | |
| 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 the number of elements contained in the xtd::collections::generic::icollection <type_t>.
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< intptr, item >, xtd::collections::generic::dictionary< key_type, mapped_type >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::dictionary< xtd::intptr, xtd::ptr< collection_type > >, 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 a value indicating whether the xtd::collections::generic::icollection <type_t> is read-only.
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
|
nodiscardpure virtualnoexcept |
Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is synchronized (thread safe).
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
|
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< intptr, item >, xtd::collections::generic::dictionary< key_type, mapped_type >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::dictionary< xtd::intptr, xtd::ptr< collection_type > >, 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 object that can be used to synchronize access to the the xtd::collections::generic::icollection <type_t>.
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
|
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< intptr, item >, xtd::collections::generic::dictionary< key_type, mapped_type >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::dictionary< xtd::intptr, xtd::ptr< collection_type > >, 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 item to the xtd::collections::generic::icollection <type_t>.
| item | The object to add to the xtd::collections::generic::icollection <type_t>. |
| xtd::not_supported_exception | The xtd::collections::generic::icollection <type_t> is read-only. |
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
|
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 >.
|
pure virtual |
Removes all items from the xtd::collections::generic::icollection <type_t>.
| xtd::not_supported_exception | The xtd::collections::generic::icollection <type_t> is read-only. |
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< intptr, item >, xtd::collections::generic::dictionary< key_type, mapped_type >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::dictionary< xtd::intptr, xtd::ptr< collection_type > >, 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 |
Determines whether the xtd::collections::generic::icollection <type_t> contains a specific value.
| item | The object to locate in the xtd::collections::generic::icollection <type_t>. |
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
|
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 virtual |
Copies the elements of the xtd::collections::generic::icollection <type_t> to an xtd::array, starting at a particular xtd::array index.
| array | The one-dimensional xtd::array that is the destination of the elements copied from xtd::collections::generic::icollection <type_t>. The xtd::array must have zero-based indexing. |
| array_index | The zero-based index in array at which copying begins. |
| xtd::argument_exception | The number of elements in the source xtd::collections::generic::icollection <type_t> is greater than the available space from `array_index` to the end of the destination `array`. |
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
|
nodiscardpure virtual |
Returns an enumerator that iterates through a collection.
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
Implemented in xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::dictionary< intptr, item >, xtd::collections::generic::dictionary< key_type, mapped_type >, xtd::collections::generic::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::dictionary< xtd::intptr, xtd::ptr< collection_type > >, 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 |
Removes the first occurrence of a specific object from the xtd::collections::generic::icollection <type_t>.
| item | The object to remove from the xtd::collections::generic::icollection <type_t>. |
| xtd::not_supported_exception | The xtd::collections::generic::icollection <type_t> is read-only. |
Implements xtd::collections::generic::icollection< xtd::collections::generic::key_value_pair< key_t, value_t > >.
|
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::dictionary< xtd::any_object, xtd::any_object >, xtd::collections::generic::ordered_dictionary< key_t, value_t, allocator_t >, xtd::collections::generic::ordered_dictionary< xtd::any_object, xtd::any_object >, 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 >.