changes: TINF-175 TZPC-4722
[platform/upstream/libgee.git] / gee / treemultiset.vala
1 /* treemultiset.vala
2  *
3  * Copyright (C) 2009  Didier Villevalois
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  *      Didier 'Ptitjes Villevalois <ptitjes@free.fr>
21  */
22
23 /**
24  * Left-leaning red-black tree implementation of the {@link MultiSet}
25  * interface.
26  */
27 public class Gee.TreeMultiSet<G> : AbstractMultiSet<G> {
28         public CompareDataFunc<G> compare_func {
29                 get { return ((TreeMap<G, int>) _storage_map).key_compare_func; }
30         }
31
32         /**
33          * Constructs a new, empty tree multi set.
34          *
35          * If not provided, the function parameter is requested to the
36          * {@link Functions} function factory methods.
37          *
38          * @param compare_func an optional element comparator function
39          */
40         public TreeMultiSet (owned CompareDataFunc<G>? compare_func = null) {
41                 base (new TreeMap<G, int> (compare_func));
42         }
43 }