22 character(len=:),
allocatable :: key
57 map%buckets(i)%list => null()
70 do i = 1,
size(map%buckets)
71 if (
associated(map%buckets(i)%list))
then
72 call list_da(map%buckets(i)%list)
77 deallocate (map%buckets)
86 character(len=*),
intent(in) :: k
87 integer(I4B),
intent(in) :: v
94 node => this%find_node(k)
97 if (
associated(node))
then
101 if (
associated(this%buckets(h)%list))
then
102 call this%buckets(h)%list%add(k, v)
104 call list_cr(this%buckets(h)%list, k, v)
114 character(len=*),
intent(in) :: k
120 node => this%buckets(h)%list
123 do while (
associated(node))
124 if (node%key == k)
then
137 character(len=*),
intent(in) :: k
143 node => this%find_node(k)
144 if (
associated(node))
then
156 character(len=*),
intent(in) :: k
157 integer(I4B),
intent(in) :: v
170 character(len=*),
intent(in) :: k
171 integer(I4B),
intent(in) :: v
178 next%next => this%next
186 type(
nodetype),
pointer,
intent(in) :: list
192 do while (
associated(node))
203 character(len=*),
intent(in) :: k
A chaining hash map for integers.
subroutine list_da(list)
Deallocate the list.
subroutine list_cr(list, k, v)
Create a list with the given key/value pair.
type(nodetype) function, pointer find_node(this, k)
Find the node containing the given key.
integer, parameter, private hash_size
integer(i4b) function ht_get(this, k)
Get the value for the given key if it exists, otherwise return zero.
subroutine ht_add(this, k, v)
Associate the given key and value.
integer(i4b) function hash(k)
Map a character string to an integer.
subroutine, public hash_table_cr(map)
Create a hash table.
subroutine list_add(this, k, v)
Add a key/value pair to the list.
integer, parameter, private multiplier
subroutine, public hash_table_da(map)
Deallocate the hash table.
This module defines variable data types.