1 /* abstractsortedset.vala
3 * Copyright (C) 2009-2011 Maciej Piechotka
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.
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.
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
20 * Maciej Piechotka <uzytkownik2@gmail.com>
24 * Skeletal implementation of the {@link SortedSet} interface.
26 * Contains common code shared by all set implementations.
30 public abstract class Gee.AbstractSortedSet<G> : Gee.AbstractSet<G>, SortedSet<G> {
34 public abstract G first ();
39 public abstract G last ();
44 public abstract Iterator<G>? iterator_at (G element);
49 public abstract G? lower (G element);
54 public abstract G? higher (G element);
59 public abstract G? floor (G element);
64 public abstract G? ceil (G element);
69 public abstract SortedSet<G> head_set (G before);
74 public abstract SortedSet<G> tail_set (G after);
79 public abstract SortedSet<G> sub_set (G from, G to);
81 private weak SortedSet<G> _read_only_view;
86 public virtual new SortedSet<G> read_only_view {
88 SortedSet<G> instance = _read_only_view;
89 if (_read_only_view == null) {
90 instance = new ReadOnlySortedSet<G> (this);
91 _read_only_view = instance;
92 instance.add_weak_pointer ((void**) (&_read_only_view));
99 internal new virtual void reserved0() {}
100 internal new virtual void reserved1() {}
101 internal new virtual void reserved2() {}
102 internal new virtual void reserved3() {}
103 internal new virtual void reserved4() {}
104 internal new virtual void reserved5() {}
105 internal new virtual void reserved6() {}
106 internal new virtual void reserved7() {}
107 internal new virtual void reserved8() {}
108 internal new virtual void reserved9() {}