An abstract type for mapping data structures. These are data structures which consist of key-value pairs. Examples of such structures are dictionaries in Python or a hash variable in Perl.
Returns a list of the keys in this dictionary
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dictionary), | intent(in) | :: | this |
A list containing all of the keys in this dictionary
Returns a list of the values stored in this dictionary, in the same order as the corresponding keys are returned when keys is called
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dictionary), | intent(in) | :: | this |
A list containing all of the values in this dictionary, stored in the same order as their corresponding key would be were keys called
Sets the given key to the give value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dictionary), | intent(inout) | :: | this | |||
class(*), | intent(in) | :: | key | The key whose value is to be set |
||
class(*), | intent(in) | :: | val | The value to be assigned to the specified key |
Returns a container of the dynamics type used to store keys
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dictionary), | intent(in) | :: | this |
A container of the dynamic type used to store this dictionary's keys or values.
Returns a container of dynamics the type used to store values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dictionary), | intent(in) | :: | this |
A container of the dynamic type used to store this dictionary's keys or values.
type, public, extends(data_set), abstract :: dictionary
!* Author: Chris MacMackin
! Date: March 2016
!
! An abstract type for mapping data structures. These are data
! structures which consist of key-value pairs. Examples of such
! structures are
! [dictionaries](https://docs.python.org/2/library/stdtypes.html#mapping-types-dict)
! in Python or a
! [hash](https://en.wikibooks.org/wiki/Perl_Programming/Hash_Variables)
! variable in Perl.
!
contains
procedure(keys_func), deferred :: keys
!! Returns a list of the keys in this dictionary
procedure(values_func), deferred :: values
!! Returns a list of the values stored in this dictionary, in the
!! same order as the corresponding keys are returned when
!! [[dictionary:keys]] is called
procedure(set_func), deferred :: set
!! Sets the given key to the give value
procedure(type_func), deferred :: key_type
!! Returns a [[container]] of the dynamics type used to store keys
procedure(type_func), deferred :: value_type
!! Returns a [[container]] of dynamics the type used to store
!! values
end type dictionary