Provides an abstract type for a multi-set data structure. These
behave like a normal set, except they keep count of the number of
times which an item has been added. When an item is removed, the
count will be decremented by 1. The item will only become absent
from the list (has returns .false.
) when the count
reaches zero.
Returns the number of times this item is present in the set.
type, public, extends(dynamic_set), abstract :: multiset
!* Author: Chris MacMackin
! Date: March 2016
! License: LGPLv3
!
! Provides an abstract type for a multi-set data structure. These
! behave like a normal set, except they keep count of the number of
! times which an item has been added. When an item is removed, the
! count will be decremented by 1. The item will only become absent
! from the list ([[data_set:has]] returns `.false.`) when the count
! reaches zero.
!
contains
procedure(get_func), deferred :: get
!! Returns the number of times this item is present in the set.
end type multiset