Update Changelog
[profile/ivi/libgee.git] / gee / hashmultiset.vala
1 /* hashmultiset.vala
2  *
3  * Copyright (C) 2009  Ali Sabil
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Ali Sabil <ali.sabil@gmail.com>
21  */
22
23 /**
24  * Hash table implementation of the {@link MultiSet} interface.
25  */
26 public class Gee.HashMultiSet<G> : AbstractMultiSet<G> {
27         public HashDataFunc<G> hash_func {
28                 get { return ((HashMap<G, int>) _storage_map).key_hash_func; }
29         }
30
31         public EqualDataFunc<G> equal_func {
32                 get { return ((HashMap<G, int>) _storage_map).key_equal_func; }
33         }
34
35         /**
36          * Constructs a new, empty hash multi set.
37          *
38          * If not provided, the functions parameters are requested to the
39          * {@link Functions} function factory methods.
40          *
41          * @param hash_func an optional element hash function
42          * @param equal_func an optional element equality testing function
43          */
44         public HashMultiSet (HashDataFunc<G>? hash_func = null, EqualDataFunc<G>? equal_func = null) {
45                 base (new HashMap<G, int> (hash_func, equal_func));
46         }
47 }