Update Changelog
[profile/ivi/libgee.git] / gee / arraylist.c
1 /* arraylist.c generated by valac 0.18.0, the Vala compiler
2  * generated from arraylist.vala, do not modify */
3
4 /* arraylist.vala
5  *
6  * Copyright (C) 2004-2005  Novell, Inc
7  * Copyright (C) 2005  David Waite
8  * Copyright (C) 2007-2008  Jürg Billeter
9  * Copyright (C) 2009  Didier Villevalois
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
24  *
25  * Author:
26  *      Jürg Billeter <j@bitron.ch>
27  *      Didier 'Ptitjes Villevalois <ptitjes@free.fr>
28  */
29
30 #include <glib.h>
31 #include <glib-object.h>
32 #include <string.h>
33
34
35 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
36 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
37 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
38 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
39
40 typedef struct _GeeTraversable GeeTraversable;
41 typedef struct _GeeTraversableIface GeeTraversableIface;
42
43 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
44
45 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
46 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
47 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
48 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
49 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
50 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
51
52 typedef struct _GeeLazy GeeLazy;
53 typedef struct _GeeLazyClass GeeLazyClass;
54
55 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
56 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
57 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
58 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
59
60 typedef struct _GeeIterator GeeIterator;
61 typedef struct _GeeIteratorIface GeeIteratorIface;
62
63 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
64 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
65 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
66 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
67
68 typedef struct _GeeIterable GeeIterable;
69 typedef struct _GeeIterableIface GeeIterableIface;
70
71 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
72 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
73 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
74 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
75
76 typedef struct _GeeCollection GeeCollection;
77 typedef struct _GeeCollectionIface GeeCollectionIface;
78
79 #define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ())
80 #define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection))
81 #define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
82 #define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION))
83 #define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION))
84 #define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
85
86 typedef struct _GeeAbstractCollection GeeAbstractCollection;
87 typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass;
88 typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate;
89
90 #define GEE_TYPE_LIST (gee_list_get_type ())
91 #define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList))
92 #define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST))
93 #define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface))
94
95 typedef struct _GeeList GeeList;
96 typedef struct _GeeListIface GeeListIface;
97
98 #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ())
99 #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator))
100 #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR))
101 #define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface))
102
103 typedef struct _GeeListIterator GeeListIterator;
104 typedef struct _GeeListIteratorIface GeeListIteratorIface;
105
106 #define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ())
107 #define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList))
108 #define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
109 #define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST))
110 #define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST))
111 #define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
112
113 typedef struct _GeeAbstractList GeeAbstractList;
114 typedef struct _GeeAbstractListClass GeeAbstractListClass;
115 typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate;
116
117 #define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ())
118 #define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList))
119 #define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST))
120 #define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface))
121
122 typedef struct _GeeBidirList GeeBidirList;
123 typedef struct _GeeBidirListIface GeeBidirListIface;
124
125 #define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ())
126 #define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator))
127 #define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR))
128 #define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface))
129
130 typedef struct _GeeBidirIterator GeeBidirIterator;
131 typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface;
132
133 #define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ())
134 #define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator))
135 #define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR))
136 #define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface))
137
138 typedef struct _GeeBidirListIterator GeeBidirListIterator;
139 typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface;
140
141 #define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ())
142 #define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList))
143 #define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass))
144 #define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST))
145 #define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST))
146 #define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass))
147
148 typedef struct _GeeAbstractBidirList GeeAbstractBidirList;
149 typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass;
150 typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate;
151
152 #define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ())
153 #define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList))
154 #define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass))
155 #define GEE_IS_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_LIST))
156 #define GEE_IS_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_LIST))
157 #define GEE_ARRAY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayListClass))
158
159 typedef struct _GeeArrayList GeeArrayList;
160 typedef struct _GeeArrayListClass GeeArrayListClass;
161 typedef struct _GeeArrayListPrivate GeeArrayListPrivate;
162
163 #define GEE_ARRAY_LIST_TYPE_ITERATOR (gee_array_list_iterator_get_type ())
164 #define GEE_ARRAY_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator))
165 #define GEE_ARRAY_LIST_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIteratorClass))
166 #define GEE_ARRAY_LIST_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ARRAY_LIST_TYPE_ITERATOR))
167 #define GEE_ARRAY_LIST_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ARRAY_LIST_TYPE_ITERATOR))
168 #define GEE_ARRAY_LIST_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIteratorClass))
169
170 typedef struct _GeeArrayListIterator GeeArrayListIterator;
171 typedef struct _GeeArrayListIteratorClass GeeArrayListIteratorClass;
172 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
173 typedef struct _GeeArrayListIteratorPrivate GeeArrayListIteratorPrivate;
174 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
175
176 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
177 typedef enum  {
178         GEE_TRAVERSABLE_STREAM_YIELD,
179         GEE_TRAVERSABLE_STREAM_CONTINUE,
180         GEE_TRAVERSABLE_STREAM_END
181 } GeeTraversableStream;
182
183 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
184 struct _GeeIteratorIface {
185         GTypeInterface parent_iface;
186         gboolean (*next) (GeeIterator* self);
187         gboolean (*has_next) (GeeIterator* self);
188         gpointer (*get) (GeeIterator* self);
189         void (*remove) (GeeIterator* self);
190         gboolean (*get_valid) (GeeIterator* self);
191         gboolean (*get_read_only) (GeeIterator* self);
192 };
193
194 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
195 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
196 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
197 struct _GeeTraversableIface {
198         GTypeInterface parent_iface;
199         GType (*get_g_type) (GeeTraversable* self);
200         GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
201         GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
202         gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
203         GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
204         gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
205         GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
206         GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
207         GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
208         GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
209         GType (*get_element_type) (GeeTraversable* self);
210 };
211
212 struct _GeeIterableIface {
213         GTypeInterface parent_iface;
214         GType (*get_g_type) (GeeIterable* self);
215         GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
216         GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
217         GeeIterator* (*iterator) (GeeIterable* self);
218 };
219
220 struct _GeeCollectionIface {
221         GTypeInterface parent_iface;
222         GType (*get_g_type) (GeeCollection* self);
223         GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
224         GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
225         gboolean (*contains) (GeeCollection* self, gconstpointer item);
226         gboolean (*add) (GeeCollection* self, gconstpointer item);
227         gboolean (*remove) (GeeCollection* self, gconstpointer item);
228         void (*clear) (GeeCollection* self);
229         gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
230         gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
231         gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
232         gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
233         gpointer* (*to_array) (GeeCollection* self, int* result_length1);
234         gint (*get_size) (GeeCollection* self);
235         gboolean (*get_is_empty) (GeeCollection* self);
236         gboolean (*get_read_only) (GeeCollection* self);
237         GeeCollection* (*get_read_only_view) (GeeCollection* self);
238 };
239
240 struct _GeeAbstractCollection {
241         GObject parent_instance;
242         GeeAbstractCollectionPrivate * priv;
243 };
244
245 struct _GeeAbstractCollectionClass {
246         GObjectClass parent_class;
247         gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item);
248         gboolean (*add) (GeeAbstractCollection* self, gconstpointer item);
249         gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item);
250         void (*clear) (GeeAbstractCollection* self);
251         GeeIterator* (*iterator) (GeeAbstractCollection* self);
252         gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target);
253         void (*reserved0) (GeeAbstractCollection* self);
254         void (*reserved1) (GeeAbstractCollection* self);
255         void (*reserved2) (GeeAbstractCollection* self);
256         void (*reserved3) (GeeAbstractCollection* self);
257         void (*reserved4) (GeeAbstractCollection* self);
258         void (*reserved5) (GeeAbstractCollection* self);
259         void (*reserved6) (GeeAbstractCollection* self);
260         void (*reserved7) (GeeAbstractCollection* self);
261         void (*reserved8) (GeeAbstractCollection* self);
262         void (*reserved9) (GeeAbstractCollection* self);
263         gint (*get_size) (GeeAbstractCollection* self);
264         gboolean (*get_read_only) (GeeAbstractCollection* self);
265         GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self);
266 };
267
268 struct _GeeListIteratorIface {
269         GTypeInterface parent_iface;
270         void (*set) (GeeListIterator* self, gconstpointer item);
271         void (*add) (GeeListIterator* self, gconstpointer item);
272         gint (*index) (GeeListIterator* self);
273 };
274
275 struct _GeeListIface {
276         GTypeInterface parent_iface;
277         GType (*get_g_type) (GeeList* self);
278         GBoxedCopyFunc (*get_g_dup_func) (GeeList* self);
279         GDestroyNotify (*get_g_destroy_func) (GeeList* self);
280         GeeListIterator* (*list_iterator) (GeeList* self);
281         gpointer (*get) (GeeList* self, gint index);
282         void (*set) (GeeList* self, gint index, gconstpointer item);
283         gint (*index_of) (GeeList* self, gconstpointer item);
284         void (*insert) (GeeList* self, gint index, gconstpointer item);
285         gpointer (*remove_at) (GeeList* self, gint index);
286         GeeList* (*slice) (GeeList* self, gint start, gint stop);
287         gpointer (*first) (GeeList* self);
288         gpointer (*last) (GeeList* self);
289         void (*insert_all) (GeeList* self, gint index, GeeCollection* collection);
290         void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
291         GeeList* (*get_read_only_view) (GeeList* self);
292 };
293
294 struct _GeeAbstractList {
295         GeeAbstractCollection parent_instance;
296         GeeAbstractListPrivate * priv;
297 };
298
299 struct _GeeAbstractListClass {
300         GeeAbstractCollectionClass parent_class;
301         GeeListIterator* (*list_iterator) (GeeAbstractList* self);
302         gpointer (*get) (GeeAbstractList* self, gint index);
303         void (*set) (GeeAbstractList* self, gint index, gconstpointer item);
304         gint (*index_of) (GeeAbstractList* self, gconstpointer item);
305         void (*insert) (GeeAbstractList* self, gint index, gconstpointer item);
306         gpointer (*remove_at) (GeeAbstractList* self, gint index);
307         GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop);
308         void (*reserved0) (GeeAbstractList* self);
309         void (*reserved1) (GeeAbstractList* self);
310         void (*reserved2) (GeeAbstractList* self);
311         void (*reserved3) (GeeAbstractList* self);
312         void (*reserved4) (GeeAbstractList* self);
313         void (*reserved5) (GeeAbstractList* self);
314         void (*reserved6) (GeeAbstractList* self);
315         void (*reserved7) (GeeAbstractList* self);
316         void (*reserved8) (GeeAbstractList* self);
317         void (*reserved9) (GeeAbstractList* self);
318         GeeList* (*get_read_only_view) (GeeAbstractList* self);
319 };
320
321 struct _GeeBidirIteratorIface {
322         GTypeInterface parent_iface;
323         GType (*get_g_type) (GeeBidirIterator* self);
324         GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self);
325         GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self);
326         gboolean (*previous) (GeeBidirIterator* self);
327         gboolean (*has_previous) (GeeBidirIterator* self);
328         gboolean (*first) (GeeBidirIterator* self);
329         gboolean (*last) (GeeBidirIterator* self);
330 };
331
332 struct _GeeBidirListIteratorIface {
333         GTypeInterface parent_iface;
334         GType (*get_g_type) (GeeBidirListIterator* self);
335         GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self);
336         GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self);
337         void (*insert) (GeeBidirListIterator* self, gconstpointer item);
338 };
339
340 struct _GeeBidirListIface {
341         GTypeInterface parent_iface;
342         GType (*get_g_type) (GeeBidirList* self);
343         GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self);
344         GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self);
345         GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self);
346         GeeBidirList* (*get_read_only_view) (GeeBidirList* self);
347 };
348
349 struct _GeeAbstractBidirList {
350         GeeAbstractList parent_instance;
351         GeeAbstractBidirListPrivate * priv;
352 };
353
354 struct _GeeAbstractBidirListClass {
355         GeeAbstractListClass parent_class;
356         GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self);
357         void (*reserved0) (GeeAbstractBidirList* self);
358         void (*reserved1) (GeeAbstractBidirList* self);
359         void (*reserved2) (GeeAbstractBidirList* self);
360         void (*reserved3) (GeeAbstractBidirList* self);
361         void (*reserved4) (GeeAbstractBidirList* self);
362         void (*reserved5) (GeeAbstractBidirList* self);
363         void (*reserved6) (GeeAbstractBidirList* self);
364         void (*reserved7) (GeeAbstractBidirList* self);
365         void (*reserved8) (GeeAbstractBidirList* self);
366         void (*reserved9) (GeeAbstractBidirList* self);
367         GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self);
368 };
369
370 struct _GeeArrayList {
371         GeeAbstractBidirList parent_instance;
372         GeeArrayListPrivate * priv;
373         gpointer* _items;
374         gint _items_length1;
375         gint __items_size_;
376         gint _size;
377 };
378
379 struct _GeeArrayListClass {
380         GeeAbstractBidirListClass parent_class;
381 };
382
383 typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data);
384 struct _GeeArrayListPrivate {
385         GType g_type;
386         GBoxedCopyFunc g_dup_func;
387         GDestroyNotify g_destroy_func;
388         GeeEqualDataFunc _equal_func;
389         gpointer _equal_func_target;
390         GDestroyNotify _equal_func_target_destroy_notify;
391         gint _stamp;
392 };
393
394 struct _GeeArrayListIterator {
395         GObject parent_instance;
396         GeeArrayListIteratorPrivate * priv;
397 };
398
399 struct _GeeArrayListIteratorClass {
400         GObjectClass parent_class;
401 };
402
403 struct _GeeArrayListIteratorPrivate {
404         GType g_type;
405         GBoxedCopyFunc g_dup_func;
406         GDestroyNotify g_destroy_func;
407         GeeArrayList* _list;
408         gint _index;
409         gboolean _removed;
410         gint _stamp;
411 };
412
413
414 static gpointer gee_array_list_parent_class = NULL;
415 static gpointer gee_array_list_iterator_parent_class = NULL;
416 static GeeTraversableIface* gee_array_list_iterator_gee_traversable_parent_iface = NULL;
417 static GeeIteratorIface* gee_array_list_iterator_gee_iterator_parent_iface = NULL;
418 static GeeBidirIteratorIface* gee_array_list_iterator_gee_bidir_iterator_parent_iface = NULL;
419 static GeeListIteratorIface* gee_array_list_iterator_gee_list_iterator_parent_iface = NULL;
420 static GeeBidirListIteratorIface* gee_array_list_iterator_gee_bidir_list_iterator_parent_iface = NULL;
421
422 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
423 gpointer gee_lazy_ref (gpointer instance);
424 void gee_lazy_unref (gpointer instance);
425 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
426 void gee_value_set_lazy (GValue* value, gpointer v_object);
427 void gee_value_take_lazy (GValue* value, gpointer v_object);
428 gpointer gee_value_get_lazy (const GValue* value);
429 GType gee_lazy_get_type (void) G_GNUC_CONST;
430 GType gee_iterator_get_type (void) G_GNUC_CONST;
431 GType gee_traversable_get_type (void) G_GNUC_CONST;
432 GType gee_iterable_get_type (void) G_GNUC_CONST;
433 GType gee_collection_get_type (void) G_GNUC_CONST;
434 GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
435 GType gee_list_iterator_get_type (void) G_GNUC_CONST;
436 GType gee_list_get_type (void) G_GNUC_CONST;
437 GType gee_abstract_list_get_type (void) G_GNUC_CONST;
438 GType gee_bidir_iterator_get_type (void) G_GNUC_CONST;
439 GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST;
440 GType gee_bidir_list_get_type (void) G_GNUC_CONST;
441 GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST;
442 GType gee_array_list_get_type (void) G_GNUC_CONST;
443 #define GEE_ARRAY_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ARRAY_LIST, GeeArrayListPrivate))
444 enum  {
445         GEE_ARRAY_LIST_DUMMY_PROPERTY,
446         GEE_ARRAY_LIST_G_TYPE,
447         GEE_ARRAY_LIST_G_DUP_FUNC,
448         GEE_ARRAY_LIST_G_DESTROY_FUNC,
449         GEE_ARRAY_LIST_SIZE,
450         GEE_ARRAY_LIST_READ_ONLY
451 };
452 GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
453 GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
454 GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
455 GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
456 static void gee_array_list_set_equal_func (GeeArrayList* self, GeeEqualDataFunc value, gpointer value_target);
457 GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
458 GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
459 static gpointer* _vala_array_dup1 (gpointer* self, int length, GBoxedCopyFunc g_dup_func);
460 static gboolean gee_array_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target);
461 static GeeIterator* gee_array_list_real_iterator (GeeAbstractCollection* base);
462 static GeeArrayListIterator* gee_array_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list);
463 static GeeArrayListIterator* gee_array_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list);
464 static GType gee_array_list_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
465 static GeeListIterator* gee_array_list_real_list_iterator (GeeAbstractList* base);
466 static GeeBidirListIterator* gee_array_list_real_bidir_list_iterator (GeeAbstractBidirList* base);
467 static gboolean gee_array_list_real_contains (GeeAbstractCollection* base, gconstpointer item);
468 gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item);
469 static gint gee_array_list_real_index_of (GeeAbstractList* base, gconstpointer item);
470 GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target);
471 static gpointer gee_array_list_real_get (GeeAbstractList* base, gint index);
472 static void gee_array_list_real_set (GeeAbstractList* base, gint index, gconstpointer item);
473 static gboolean gee_array_list_real_add (GeeAbstractCollection* base, gconstpointer item);
474 static void gee_array_list_grow_if_needed (GeeArrayList* self, gint new_count);
475 static void gee_array_list_real_insert (GeeAbstractList* base, gint index, gconstpointer item);
476 static void gee_array_list_shift (GeeArrayList* self, gint start, gint delta);
477 static gboolean gee_array_list_real_remove (GeeAbstractCollection* base, gconstpointer item);
478 gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index);
479 static gpointer gee_array_list_real_remove_at (GeeAbstractList* base, gint index);
480 static void gee_array_list_real_clear (GeeAbstractCollection* base);
481 static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gint stop);
482 gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item);
483 gpointer gee_abstract_list_get (GeeAbstractList* self, gint index);
484 gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection);
485 gboolean gee_collection_get_is_empty (GeeCollection* self);
486 gint gee_collection_get_size (GeeCollection* self);
487 gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target);
488 static gboolean __lambda28_ (GeeArrayList* self, gpointer item);
489 static gboolean ___lambda28__gee_forall_func (gpointer g, gpointer self);
490 static void gee_array_list_set_capacity (GeeArrayList* self, gint value);
491 #define GEE_ARRAY_LIST_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIteratorPrivate))
492 enum  {
493         GEE_ARRAY_LIST_ITERATOR_DUMMY_PROPERTY,
494         GEE_ARRAY_LIST_ITERATOR_G_TYPE,
495         GEE_ARRAY_LIST_ITERATOR_G_DUP_FUNC,
496         GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC,
497         GEE_ARRAY_LIST_ITERATOR_READ_ONLY,
498         GEE_ARRAY_LIST_ITERATOR_VALID
499 };
500 static gboolean gee_array_list_iterator_real_next (GeeIterator* base);
501 static gboolean gee_array_list_iterator_real_has_next (GeeIterator* base);
502 static gboolean gee_array_list_iterator_real_first (GeeBidirIterator* base);
503 gint gee_abstract_collection_get_size (GeeAbstractCollection* self);
504 static gpointer gee_array_list_iterator_real_get (GeeIterator* base);
505 static void gee_array_list_iterator_real_remove (GeeIterator* base);
506 static gboolean gee_array_list_iterator_real_previous (GeeBidirIterator* base);
507 static gboolean gee_array_list_iterator_real_has_previous (GeeBidirIterator* base);
508 static gboolean gee_array_list_iterator_real_last (GeeBidirIterator* base);
509 static void gee_array_list_iterator_real_set (GeeListIterator* base, gconstpointer item);
510 static void gee_array_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item);
511 void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item);
512 static void gee_array_list_iterator_real_add (GeeListIterator* base, gconstpointer item);
513 static gint gee_array_list_iterator_real_index (GeeListIterator* base);
514 static gboolean gee_array_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
515 static void gee_array_list_iterator_finalize (GObject* obj);
516 gboolean gee_iterator_get_read_only (GeeIterator* self);
517 gboolean gee_iterator_get_valid (GeeIterator* self);
518 static void _vala_gee_array_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
519 static void _vala_gee_array_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
520 static void gee_array_list_finalize (GObject* obj);
521 gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self);
522 static void _vala_gee_array_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
523 static void _vala_gee_array_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
524 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
525 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
526 static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length);
527
528
529 /**
530  * Constructs a new, empty array list.
531  *
532  * If not provided, the function parameter is requested to the
533  * {@link Functions} function factory methods.
534  *
535  * @param equal_func an optional element equality testing function
536  */
537 GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
538         GeeArrayList * self = NULL;
539         GeeEqualDataFunc _tmp0_;
540         void* _tmp0__target;
541         GeeEqualDataFunc _tmp4_;
542         void* _tmp4__target;
543         gpointer* _tmp5_ = NULL;
544         self = (GeeArrayList*) gee_abstract_bidir_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
545         self->priv->g_type = g_type;
546         self->priv->g_dup_func = g_dup_func;
547         self->priv->g_destroy_func = g_destroy_func;
548         _tmp0_ = equal_func;
549         _tmp0__target = equal_func_target;
550         if (_tmp0_ == NULL) {
551                 void* _tmp1_ = NULL;
552                 GDestroyNotify _tmp2_ = NULL;
553                 GeeEqualDataFunc _tmp3_ = NULL;
554                 _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_);
555                 (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
556                 equal_func = NULL;
557                 equal_func_target = NULL;
558                 equal_func_target_destroy_notify = NULL;
559                 equal_func = _tmp3_;
560                 equal_func_target = _tmp1_;
561                 equal_func_target_destroy_notify = _tmp2_;
562         }
563         _tmp4_ = equal_func;
564         _tmp4__target = equal_func_target;
565         gee_array_list_set_equal_func (self, _tmp4_, _tmp4__target);
566         _tmp5_ = g_new0 (gpointer, 4);
567         self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) g_destroy_func), NULL);
568         self->_items = _tmp5_;
569         self->_items_length1 = 4;
570         self->__items_size_ = self->_items_length1;
571         self->_size = 0;
572         (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
573         equal_func = NULL;
574         equal_func_target = NULL;
575         equal_func_target_destroy_notify = NULL;
576         return self;
577 }
578
579
580 GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
581         return gee_array_list_construct (GEE_TYPE_ARRAY_LIST, g_type, g_dup_func, g_destroy_func, equal_func, equal_func_target, equal_func_target_destroy_notify);
582 }
583
584
585 /**
586  * Constructs a new array list based on provided array.
587  *
588  * If not provided, the function parameter is requested to the
589  * {@link Functions} function factory methods.
590  *
591  * @param items initial items to be put into array
592  * @param equal_func an optional element equality testing function
593  */
594 static gpointer* _vala_array_dup1 (gpointer* self, int length, GBoxedCopyFunc g_dup_func) {
595         gpointer* result;
596         int i;
597         result = g_new0 (gpointer, length);
598         for (i = 0; i < length; i++) {
599                 gpointer _tmp0_;
600                 _tmp0_ = ((self[i] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) self[i]) : ((gpointer) self[i]);
601                 result[i] = _tmp0_;
602         }
603         return result;
604 }
605
606
607 GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
608         GeeArrayList * self = NULL;
609         GeeEqualDataFunc _tmp0_;
610         void* _tmp0__target;
611         GeeEqualDataFunc _tmp4_;
612         void* _tmp4__target;
613         gpointer* _tmp5_;
614         gint _tmp5__length1;
615         gpointer* _tmp6_;
616         gint _tmp6__length1;
617         gpointer* _tmp7_;
618         gint _tmp7__length1;
619         self = (GeeArrayList*) gee_abstract_bidir_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
620         self->priv->g_type = g_type;
621         self->priv->g_dup_func = g_dup_func;
622         self->priv->g_destroy_func = g_destroy_func;
623         _tmp0_ = equal_func;
624         _tmp0__target = equal_func_target;
625         if (_tmp0_ == NULL) {
626                 void* _tmp1_ = NULL;
627                 GDestroyNotify _tmp2_ = NULL;
628                 GeeEqualDataFunc _tmp3_ = NULL;
629                 _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_);
630                 (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
631                 equal_func = NULL;
632                 equal_func_target = NULL;
633                 equal_func_target_destroy_notify = NULL;
634                 equal_func = _tmp3_;
635                 equal_func_target = _tmp1_;
636                 equal_func_target_destroy_notify = _tmp2_;
637         }
638         _tmp4_ = equal_func;
639         _tmp4__target = equal_func_target;
640         gee_array_list_set_equal_func (self, _tmp4_, _tmp4__target);
641         _tmp5_ = items;
642         _tmp5__length1 = items_length1;
643         _tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup1 (_tmp5_, _tmp5__length1, g_dup_func) : ((gpointer) _tmp5_);
644         _tmp6__length1 = _tmp5__length1;
645         self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) g_destroy_func), NULL);
646         self->_items = _tmp6_;
647         self->_items_length1 = _tmp6__length1;
648         self->__items_size_ = self->_items_length1;
649         _tmp7_ = items;
650         _tmp7__length1 = items_length1;
651         self->_size = _tmp7__length1;
652         items = (_vala_array_free (items, items_length1, (GDestroyNotify) g_destroy_func), NULL);
653         (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
654         equal_func = NULL;
655         equal_func_target = NULL;
656         equal_func_target_destroy_notify = NULL;
657         return self;
658 }
659
660
661 GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
662         return gee_array_list_construct_wrap (GEE_TYPE_ARRAY_LIST, g_type, g_dup_func, g_destroy_func, items, items_length1, equal_func, equal_func_target, equal_func_target_destroy_notify);
663 }
664
665
666 /**
667  * {@inheritDoc}
668  */
669 static gboolean gee_array_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target) {
670         GeeArrayList * self;
671         gboolean result = FALSE;
672         self = (GeeArrayList*) base;
673         {
674                 gint i;
675                 i = 0;
676                 {
677                         gboolean _tmp0_;
678                         _tmp0_ = TRUE;
679                         while (TRUE) {
680                                 gboolean _tmp1_;
681                                 gint _tmp3_;
682                                 gint _tmp4_;
683                                 GeeForallFunc _tmp5_;
684                                 void* _tmp5__target;
685                                 gpointer* _tmp6_;
686                                 gint _tmp6__length1;
687                                 gint _tmp7_;
688                                 gconstpointer _tmp8_;
689                                 gpointer _tmp9_;
690                                 gboolean _tmp10_ = FALSE;
691                                 _tmp1_ = _tmp0_;
692                                 if (!_tmp1_) {
693                                         gint _tmp2_;
694                                         _tmp2_ = i;
695                                         i = _tmp2_ + 1;
696                                 }
697                                 _tmp0_ = FALSE;
698                                 _tmp3_ = i;
699                                 _tmp4_ = self->_size;
700                                 if (!(_tmp3_ < _tmp4_)) {
701                                         break;
702                                 }
703                                 _tmp5_ = f;
704                                 _tmp5__target = f_target;
705                                 _tmp6_ = self->_items;
706                                 _tmp6__length1 = self->_items_length1;
707                                 _tmp7_ = i;
708                                 _tmp8_ = _tmp6_[_tmp7_];
709                                 _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
710                                 _tmp10_ = _tmp5_ (_tmp9_, _tmp5__target);
711                                 if (!_tmp10_) {
712                                         result = FALSE;
713                                         return result;
714                                 }
715                         }
716                 }
717         }
718         result = TRUE;
719         return result;
720 }
721
722
723 /**
724  * {@inheritDoc}
725  */
726 static GeeIterator* gee_array_list_real_iterator (GeeAbstractCollection* base) {
727         GeeArrayList * self;
728         GeeIterator* result = NULL;
729         GeeArrayListIterator* _tmp0_;
730         self = (GeeArrayList*) base;
731         _tmp0_ = gee_array_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
732         result = (GeeIterator*) _tmp0_;
733         return result;
734 }
735
736
737 /**
738  * {@inheritDoc}
739  */
740 static GeeListIterator* gee_array_list_real_list_iterator (GeeAbstractList* base) {
741         GeeArrayList * self;
742         GeeListIterator* result = NULL;
743         GeeArrayListIterator* _tmp0_;
744         self = (GeeArrayList*) base;
745         _tmp0_ = gee_array_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
746         result = (GeeListIterator*) _tmp0_;
747         return result;
748 }
749
750
751 /**
752  * {@inheritDoc}
753  */
754 static GeeBidirListIterator* gee_array_list_real_bidir_list_iterator (GeeAbstractBidirList* base) {
755         GeeArrayList * self;
756         GeeBidirListIterator* result = NULL;
757         GeeArrayListIterator* _tmp0_;
758         self = (GeeArrayList*) base;
759         _tmp0_ = gee_array_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
760         result = (GeeBidirListIterator*) _tmp0_;
761         return result;
762 }
763
764
765 /**
766  * {@inheritDoc}
767  */
768 static gboolean gee_array_list_real_contains (GeeAbstractCollection* base, gconstpointer item) {
769         GeeArrayList * self;
770         gboolean result = FALSE;
771         gconstpointer _tmp0_;
772         gint _tmp1_ = 0;
773         self = (GeeArrayList*) base;
774         _tmp0_ = item;
775         _tmp1_ = gee_abstract_list_index_of ((GeeAbstractList*) self, _tmp0_);
776         result = _tmp1_ != (-1);
777         return result;
778 }
779
780
781 /**
782  * {@inheritDoc}
783  */
784 static gint gee_array_list_real_index_of (GeeAbstractList* base, gconstpointer item) {
785         GeeArrayList * self;
786         gint result = 0;
787         self = (GeeArrayList*) base;
788         {
789                 gint index;
790                 index = 0;
791                 {
792                         gboolean _tmp0_;
793                         _tmp0_ = TRUE;
794                         while (TRUE) {
795                                 gboolean _tmp1_;
796                                 gint _tmp3_;
797                                 gint _tmp4_;
798                                 GeeEqualDataFunc _tmp5_;
799                                 void* _tmp5__target;
800                                 GeeEqualDataFunc _tmp6_;
801                                 void* _tmp6__target;
802                                 gpointer* _tmp7_;
803                                 gint _tmp7__length1;
804                                 gint _tmp8_;
805                                 gconstpointer _tmp9_;
806                                 gconstpointer _tmp10_;
807                                 gboolean _tmp11_ = FALSE;
808                                 _tmp1_ = _tmp0_;
809                                 if (!_tmp1_) {
810                                         gint _tmp2_;
811                                         _tmp2_ = index;
812                                         index = _tmp2_ + 1;
813                                 }
814                                 _tmp0_ = FALSE;
815                                 _tmp3_ = index;
816                                 _tmp4_ = self->_size;
817                                 if (!(_tmp3_ < _tmp4_)) {
818                                         break;
819                                 }
820                                 _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target);
821                                 _tmp6_ = _tmp5_;
822                                 _tmp6__target = _tmp5__target;
823                                 _tmp7_ = self->_items;
824                                 _tmp7__length1 = self->_items_length1;
825                                 _tmp8_ = index;
826                                 _tmp9_ = _tmp7_[_tmp8_];
827                                 _tmp10_ = item;
828                                 _tmp11_ = _tmp6_ (_tmp9_, _tmp10_, _tmp6__target);
829                                 if (_tmp11_) {
830                                         result = index;
831                                         return result;
832                                 }
833                         }
834                 }
835         }
836         result = -1;
837         return result;
838 }
839
840
841 /**
842  * {@inheritDoc}
843  */
844 static gpointer gee_array_list_real_get (GeeAbstractList* base, gint index) {
845         GeeArrayList * self;
846         gpointer result = NULL;
847         gint _tmp0_;
848         gint _tmp1_;
849         gint _tmp2_;
850         gpointer* _tmp3_;
851         gint _tmp3__length1;
852         gint _tmp4_;
853         gconstpointer _tmp5_;
854         gpointer _tmp6_;
855         self = (GeeArrayList*) base;
856         _tmp0_ = index;
857         _vala_assert (_tmp0_ >= 0, "index >= 0");
858         _tmp1_ = index;
859         _tmp2_ = self->_size;
860         _vala_assert (_tmp1_ < _tmp2_, "index < _size");
861         _tmp3_ = self->_items;
862         _tmp3__length1 = self->_items_length1;
863         _tmp4_ = index;
864         _tmp5_ = _tmp3_[_tmp4_];
865         _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
866         result = _tmp6_;
867         return result;
868 }
869
870
871 /**
872  * {@inheritDoc}
873  */
874 static void gee_array_list_real_set (GeeAbstractList* base, gint index, gconstpointer item) {
875         GeeArrayList * self;
876         gint _tmp0_;
877         gint _tmp1_;
878         gint _tmp2_;
879         gpointer* _tmp3_;
880         gint _tmp3__length1;
881         gint _tmp4_;
882         gconstpointer _tmp5_;
883         gpointer _tmp6_;
884         gpointer _tmp7_;
885         self = (GeeArrayList*) base;
886         _tmp0_ = index;
887         _vala_assert (_tmp0_ >= 0, "index >= 0");
888         _tmp1_ = index;
889         _tmp2_ = self->_size;
890         _vala_assert (_tmp1_ < _tmp2_, "index < _size");
891         _tmp3_ = self->_items;
892         _tmp3__length1 = self->_items_length1;
893         _tmp4_ = index;
894         _tmp5_ = item;
895         _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
896         ((_tmp3_[_tmp4_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp3_[_tmp4_] = (self->priv->g_destroy_func (_tmp3_[_tmp4_]), NULL));
897         _tmp3_[_tmp4_] = _tmp6_;
898         _tmp7_ = _tmp3_[_tmp4_];
899 }
900
901
902 /**
903  * {@inheritDoc}
904  */
905 static gboolean gee_array_list_real_add (GeeAbstractCollection* base, gconstpointer item) {
906         GeeArrayList * self;
907         gboolean result = FALSE;
908         gint _tmp0_;
909         gpointer* _tmp1_;
910         gint _tmp1__length1;
911         gpointer* _tmp2_;
912         gint _tmp2__length1;
913         gint _tmp3_;
914         gconstpointer _tmp4_;
915         gpointer _tmp5_;
916         gpointer _tmp6_;
917         gint _tmp7_;
918         self = (GeeArrayList*) base;
919         _tmp0_ = self->_size;
920         _tmp1_ = self->_items;
921         _tmp1__length1 = self->_items_length1;
922         if (_tmp0_ == _tmp1__length1) {
923                 gee_array_list_grow_if_needed (self, 1);
924         }
925         _tmp2_ = self->_items;
926         _tmp2__length1 = self->_items_length1;
927         _tmp3_ = self->_size;
928         self->_size = _tmp3_ + 1;
929         _tmp4_ = item;
930         _tmp5_ = ((_tmp4_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_);
931         ((_tmp2_[_tmp3_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp2_[_tmp3_] = (self->priv->g_destroy_func (_tmp2_[_tmp3_]), NULL));
932         _tmp2_[_tmp3_] = _tmp5_;
933         _tmp6_ = _tmp2_[_tmp3_];
934         _tmp7_ = self->priv->_stamp;
935         self->priv->_stamp = _tmp7_ + 1;
936         result = TRUE;
937         return result;
938 }
939
940
941 /**
942  * {@inheritDoc}
943  */
944 static void gee_array_list_real_insert (GeeAbstractList* base, gint index, gconstpointer item) {
945         GeeArrayList * self;
946         gint _tmp0_;
947         gint _tmp1_;
948         gint _tmp2_;
949         gint _tmp3_;
950         gpointer* _tmp4_;
951         gint _tmp4__length1;
952         gint _tmp5_;
953         gpointer* _tmp6_;
954         gint _tmp6__length1;
955         gint _tmp7_;
956         gconstpointer _tmp8_;
957         gpointer _tmp9_;
958         gpointer _tmp10_;
959         gint _tmp11_;
960         self = (GeeArrayList*) base;
961         _tmp0_ = index;
962         _vala_assert (_tmp0_ >= 0, "index >= 0");
963         _tmp1_ = index;
964         _tmp2_ = self->_size;
965         _vala_assert (_tmp1_ <= _tmp2_, "index <= _size");
966         _tmp3_ = self->_size;
967         _tmp4_ = self->_items;
968         _tmp4__length1 = self->_items_length1;
969         if (_tmp3_ == _tmp4__length1) {
970                 gee_array_list_grow_if_needed (self, 1);
971         }
972         _tmp5_ = index;
973         gee_array_list_shift (self, _tmp5_, 1);
974         _tmp6_ = self->_items;
975         _tmp6__length1 = self->_items_length1;
976         _tmp7_ = index;
977         _tmp8_ = item;
978         _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
979         ((_tmp6_[_tmp7_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp6_[_tmp7_] = (self->priv->g_destroy_func (_tmp6_[_tmp7_]), NULL));
980         _tmp6_[_tmp7_] = _tmp9_;
981         _tmp10_ = _tmp6_[_tmp7_];
982         _tmp11_ = self->priv->_stamp;
983         self->priv->_stamp = _tmp11_ + 1;
984 }
985
986
987 /**
988  * {@inheritDoc}
989  */
990 static gboolean gee_array_list_real_remove (GeeAbstractCollection* base, gconstpointer item) {
991         GeeArrayList * self;
992         gboolean result = FALSE;
993         self = (GeeArrayList*) base;
994         {
995                 gint index;
996                 index = 0;
997                 {
998                         gboolean _tmp0_;
999                         _tmp0_ = TRUE;
1000                         while (TRUE) {
1001                                 gboolean _tmp1_;
1002                                 gint _tmp3_;
1003                                 gint _tmp4_;
1004                                 GeeEqualDataFunc _tmp5_;
1005                                 void* _tmp5__target;
1006                                 GeeEqualDataFunc _tmp6_;
1007                                 void* _tmp6__target;
1008                                 gpointer* _tmp7_;
1009                                 gint _tmp7__length1;
1010                                 gint _tmp8_;
1011                                 gconstpointer _tmp9_;
1012                                 gconstpointer _tmp10_;
1013                                 gboolean _tmp11_ = FALSE;
1014                                 _tmp1_ = _tmp0_;
1015                                 if (!_tmp1_) {
1016                                         gint _tmp2_;
1017                                         _tmp2_ = index;
1018                                         index = _tmp2_ + 1;
1019                                 }
1020                                 _tmp0_ = FALSE;
1021                                 _tmp3_ = index;
1022                                 _tmp4_ = self->_size;
1023                                 if (!(_tmp3_ < _tmp4_)) {
1024                                         break;
1025                                 }
1026                                 _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target);
1027                                 _tmp6_ = _tmp5_;
1028                                 _tmp6__target = _tmp5__target;
1029                                 _tmp7_ = self->_items;
1030                                 _tmp7__length1 = self->_items_length1;
1031                                 _tmp8_ = index;
1032                                 _tmp9_ = _tmp7_[_tmp8_];
1033                                 _tmp10_ = item;
1034                                 _tmp11_ = _tmp6_ (_tmp9_, _tmp10_, _tmp6__target);
1035                                 if (_tmp11_) {
1036                                         gint _tmp12_;
1037                                         gpointer _tmp13_ = NULL;
1038                                         gpointer _tmp14_;
1039                                         _tmp12_ = index;
1040                                         _tmp13_ = gee_abstract_list_remove_at ((GeeAbstractList*) self, _tmp12_);
1041                                         _tmp14_ = _tmp13_;
1042                                         ((_tmp14_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp14_ = (self->priv->g_destroy_func (_tmp14_), NULL));
1043                                         result = TRUE;
1044                                         return result;
1045                                 }
1046                         }
1047                 }
1048         }
1049         result = FALSE;
1050         return result;
1051 }
1052
1053
1054 /**
1055  * {@inheritDoc}
1056  */
1057 static gpointer gee_array_list_real_remove_at (GeeAbstractList* base, gint index) {
1058         GeeArrayList * self;
1059         gpointer result = NULL;
1060         gint _tmp0_;
1061         gint _tmp1_;
1062         gint _tmp2_;
1063         gpointer* _tmp3_;
1064         gint _tmp3__length1;
1065         gint _tmp4_;
1066         gconstpointer _tmp5_;
1067         gpointer _tmp6_;
1068         gpointer item;
1069         gpointer* _tmp7_;
1070         gint _tmp7__length1;
1071         gint _tmp8_;
1072         gpointer _tmp9_;
1073         gint _tmp10_;
1074         gint _tmp11_;
1075         self = (GeeArrayList*) base;
1076         _tmp0_ = index;
1077         _vala_assert (_tmp0_ >= 0, "index >= 0");
1078         _tmp1_ = index;
1079         _tmp2_ = self->_size;
1080         _vala_assert (_tmp1_ < _tmp2_, "index < _size");
1081         _tmp3_ = self->_items;
1082         _tmp3__length1 = self->_items_length1;
1083         _tmp4_ = index;
1084         _tmp5_ = _tmp3_[_tmp4_];
1085         _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
1086         item = _tmp6_;
1087         _tmp7_ = self->_items;
1088         _tmp7__length1 = self->_items_length1;
1089         _tmp8_ = index;
1090         ((_tmp7_[_tmp8_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp7_[_tmp8_] = (self->priv->g_destroy_func (_tmp7_[_tmp8_]), NULL));
1091         _tmp7_[_tmp8_] = NULL;
1092         _tmp9_ = _tmp7_[_tmp8_];
1093         _tmp10_ = index;
1094         gee_array_list_shift (self, _tmp10_ + 1, -1);
1095         _tmp11_ = self->priv->_stamp;
1096         self->priv->_stamp = _tmp11_ + 1;
1097         result = item;
1098         return result;
1099 }
1100
1101
1102 /**
1103  * {@inheritDoc}
1104  */
1105 static void gee_array_list_real_clear (GeeAbstractCollection* base) {
1106         GeeArrayList * self;
1107         gint _tmp8_;
1108         self = (GeeArrayList*) base;
1109         {
1110                 gint index;
1111                 index = 0;
1112                 {
1113                         gboolean _tmp0_;
1114                         _tmp0_ = TRUE;
1115                         while (TRUE) {
1116                                 gboolean _tmp1_;
1117                                 gint _tmp3_;
1118                                 gint _tmp4_;
1119                                 gpointer* _tmp5_;
1120                                 gint _tmp5__length1;
1121                                 gint _tmp6_;
1122                                 gpointer _tmp7_;
1123                                 _tmp1_ = _tmp0_;
1124                                 if (!_tmp1_) {
1125                                         gint _tmp2_;
1126                                         _tmp2_ = index;
1127                                         index = _tmp2_ + 1;
1128                                 }
1129                                 _tmp0_ = FALSE;
1130                                 _tmp3_ = index;
1131                                 _tmp4_ = self->_size;
1132                                 if (!(_tmp3_ < _tmp4_)) {
1133                                         break;
1134                                 }
1135                                 _tmp5_ = self->_items;
1136                                 _tmp5__length1 = self->_items_length1;
1137                                 _tmp6_ = index;
1138                                 ((_tmp5_[_tmp6_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp5_[_tmp6_] = (self->priv->g_destroy_func (_tmp5_[_tmp6_]), NULL));
1139                                 _tmp5_[_tmp6_] = NULL;
1140                                 _tmp7_ = _tmp5_[_tmp6_];
1141                         }
1142                 }
1143         }
1144         self->_size = 0;
1145         _tmp8_ = self->priv->_stamp;
1146         self->priv->_stamp = _tmp8_ + 1;
1147 }
1148
1149
1150 /**
1151  * {@inheritDoc}
1152  */
1153 static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gint stop) {
1154         GeeArrayList * self;
1155         GeeList* result = NULL;
1156         gint _tmp0_;
1157         gint _tmp1_;
1158         gint _tmp2_;
1159         gint _tmp3_;
1160         gint _tmp4_;
1161         GeeEqualDataFunc _tmp5_;
1162         void* _tmp5__target;
1163         GeeEqualDataFunc _tmp6_;
1164         void* _tmp6__target;
1165         GeeArrayList* _tmp7_;
1166         GeeArrayList* slice;
1167         self = (GeeArrayList*) base;
1168         _tmp0_ = start;
1169         _tmp1_ = stop;
1170         g_return_val_if_fail (_tmp0_ <= _tmp1_, NULL);
1171         _tmp2_ = start;
1172         g_return_val_if_fail (_tmp2_ >= 0, NULL);
1173         _tmp3_ = stop;
1174         _tmp4_ = self->_size;
1175         g_return_val_if_fail (_tmp3_ <= _tmp4_, NULL);
1176         _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target);
1177         _tmp6_ = _tmp5_;
1178         _tmp6__target = _tmp5__target;
1179         _tmp7_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_, _tmp6__target, NULL);
1180         slice = _tmp7_;
1181         {
1182                 gint _tmp8_;
1183                 gint i;
1184                 _tmp8_ = start;
1185                 i = _tmp8_;
1186                 {
1187                         gboolean _tmp9_;
1188                         _tmp9_ = TRUE;
1189                         while (TRUE) {
1190                                 gboolean _tmp10_;
1191                                 gint _tmp12_;
1192                                 gint _tmp13_;
1193                                 GeeArrayList* _tmp14_;
1194                                 gint _tmp15_;
1195                                 gpointer _tmp16_ = NULL;
1196                                 gpointer _tmp17_;
1197                                 _tmp10_ = _tmp9_;
1198                                 if (!_tmp10_) {
1199                                         gint _tmp11_;
1200                                         _tmp11_ = i;
1201                                         i = _tmp11_ + 1;
1202                                 }
1203                                 _tmp9_ = FALSE;
1204                                 _tmp12_ = i;
1205                                 _tmp13_ = stop;
1206                                 if (!(_tmp12_ < _tmp13_)) {
1207                                         break;
1208                                 }
1209                                 _tmp14_ = slice;
1210                                 _tmp15_ = i;
1211                                 _tmp16_ = gee_abstract_list_get ((GeeAbstractList*) self, _tmp15_);
1212                                 _tmp17_ = _tmp16_;
1213                                 gee_abstract_collection_add ((GeeAbstractCollection*) _tmp14_, _tmp17_);
1214                                 ((_tmp17_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp17_ = (self->priv->g_destroy_func (_tmp17_), NULL));
1215                         }
1216                 }
1217         }
1218         result = (GeeList*) slice;
1219         return result;
1220 }
1221
1222
1223 /**
1224  * {@inheritDoc}
1225  */
1226 static gboolean __lambda28_ (GeeArrayList* self, gpointer item) {
1227         gboolean result = FALSE;
1228         gpointer* _tmp0_;
1229         gint _tmp0__length1;
1230         gint _tmp1_;
1231         gconstpointer _tmp2_;
1232         gpointer _tmp3_;
1233         gpointer _tmp4_;
1234         _tmp0_ = self->_items;
1235         _tmp0__length1 = self->_items_length1;
1236         _tmp1_ = self->_size;
1237         self->_size = _tmp1_ + 1;
1238         _tmp2_ = item;
1239         _tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
1240         ((_tmp0_[_tmp1_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp0_[_tmp1_] = (self->priv->g_destroy_func (_tmp0_[_tmp1_]), NULL));
1241         _tmp0_[_tmp1_] = _tmp3_;
1242         _tmp4_ = _tmp0_[_tmp1_];
1243         result = TRUE;
1244         ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
1245         return result;
1246 }
1247
1248
1249 static gboolean ___lambda28__gee_forall_func (gpointer g, gpointer self) {
1250         gboolean result;
1251         result = __lambda28_ (self, g);
1252         return result;
1253 }
1254
1255
1256 gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection) {
1257         gboolean result = FALSE;
1258         GeeCollection* _tmp0_;
1259         gboolean _tmp1_;
1260         gboolean _tmp2_;
1261         GeeCollection* _tmp3_;
1262         gint _tmp4_;
1263         gint _tmp5_;
1264         GeeCollection* _tmp6_;
1265         gint _tmp7_;
1266         g_return_val_if_fail (self != NULL, FALSE);
1267         g_return_val_if_fail (collection != NULL, FALSE);
1268         _tmp0_ = collection;
1269         _tmp1_ = gee_collection_get_is_empty (_tmp0_);
1270         _tmp2_ = _tmp1_;
1271         if (_tmp2_) {
1272                 result = FALSE;
1273                 return result;
1274         }
1275         _tmp3_ = collection;
1276         _tmp4_ = gee_collection_get_size (_tmp3_);
1277         _tmp5_ = _tmp4_;
1278         gee_array_list_grow_if_needed (self, _tmp5_);
1279         _tmp6_ = collection;
1280         gee_traversable_foreach ((GeeTraversable*) _tmp6_, ___lambda28__gee_forall_func, self);
1281         _tmp7_ = self->priv->_stamp;
1282         self->priv->_stamp = _tmp7_ + 1;
1283         result = TRUE;
1284         return result;
1285 }
1286
1287
1288 static void gee_array_list_shift (GeeArrayList* self, gint start, gint delta) {
1289         gint _tmp0_;
1290         gint _tmp1_;
1291         gint _tmp2_;
1292         gint _tmp3_;
1293         gint _tmp4_;
1294         gint _tmp5_;
1295         gint _tmp6_;
1296         gint _tmp7_;
1297         gint _tmp8_;
1298         gint _tmp9_;
1299         gint _tmp10_;
1300         gint _tmp11_;
1301         g_return_if_fail (self != NULL);
1302         _tmp0_ = start;
1303         _vala_assert (_tmp0_ >= 0, "start >= 0");
1304         _tmp1_ = start;
1305         _tmp2_ = self->_size;
1306         _vala_assert (_tmp1_ <= _tmp2_, "start <= _size");
1307         _tmp3_ = start;
1308         _tmp4_ = delta;
1309         _vala_assert (_tmp3_ >= (-_tmp4_), "start >= -delta");
1310         _tmp5_ = start;
1311         _tmp6_ = start;
1312         _tmp7_ = delta;
1313         _tmp8_ = self->_size;
1314         _tmp9_ = start;
1315         _vala_array_move (self->_items, sizeof (gpointer), _tmp5_, _tmp6_ + _tmp7_, _tmp8_ - _tmp9_);
1316         _tmp10_ = self->_size;
1317         _tmp11_ = delta;
1318         self->_size = _tmp10_ + _tmp11_;
1319 }
1320
1321
1322 static void gee_array_list_grow_if_needed (GeeArrayList* self, gint new_count) {
1323         gint _tmp0_;
1324         gint _tmp1_;
1325         gint _tmp2_;
1326         gint minimum_size;
1327         gint _tmp3_;
1328         gpointer* _tmp4_;
1329         gint _tmp4__length1;
1330         g_return_if_fail (self != NULL);
1331         _tmp0_ = new_count;
1332         _vala_assert (_tmp0_ >= 0, "new_count >= 0");
1333         _tmp1_ = self->_size;
1334         _tmp2_ = new_count;
1335         minimum_size = _tmp1_ + _tmp2_;
1336         _tmp3_ = minimum_size;
1337         _tmp4_ = self->_items;
1338         _tmp4__length1 = self->_items_length1;
1339         if (_tmp3_ > _tmp4__length1) {
1340                 gint _tmp5_ = 0;
1341                 gint _tmp6_;
1342                 gpointer* _tmp7_;
1343                 gint _tmp7__length1;
1344                 gint _tmp10_;
1345                 _tmp6_ = new_count;
1346                 _tmp7_ = self->_items;
1347                 _tmp7__length1 = self->_items_length1;
1348                 if (_tmp6_ > _tmp7__length1) {
1349                         gint _tmp8_;
1350                         _tmp8_ = minimum_size;
1351                         _tmp5_ = _tmp8_;
1352                 } else {
1353                         gpointer* _tmp9_;
1354                         gint _tmp9__length1;
1355                         _tmp9_ = self->_items;
1356                         _tmp9__length1 = self->_items_length1;
1357                         _tmp5_ = 2 * _tmp9__length1;
1358                 }
1359                 _tmp10_ = _tmp5_;
1360                 gee_array_list_set_capacity (self, _tmp10_);
1361         }
1362 }
1363
1364
1365 static void gee_array_list_set_capacity (GeeArrayList* self, gint value) {
1366         gint _tmp0_;
1367         gint _tmp1_;
1368         gint _tmp2_;
1369         gint _tmp3_ = 0;
1370         g_return_if_fail (self != NULL);
1371         _tmp0_ = value;
1372         _tmp1_ = self->_size;
1373         _vala_assert (_tmp0_ >= _tmp1_, "value >= _size");
1374         _tmp2_ = value;
1375         _tmp3_ = _tmp2_;
1376         self->_items = g_renew (gpointer, self->_items, _tmp2_);
1377         (_tmp3_ > self->_items_length1) ? memset (self->_items + self->_items_length1, 0, sizeof (gpointer) * (_tmp3_ - self->_items_length1)) : NULL;
1378         self->_items_length1 = _tmp3_;
1379         self->__items_size_ = _tmp3_;
1380 }
1381
1382
1383 static gint gee_array_list_real_get_size (GeeAbstractCollection* base) {
1384         gint result;
1385         GeeArrayList* self;
1386         gint _tmp0_;
1387         self = (GeeArrayList*) base;
1388         _tmp0_ = self->_size;
1389         result = _tmp0_;
1390         return result;
1391 }
1392
1393
1394 static gboolean gee_array_list_real_get_read_only (GeeAbstractCollection* base) {
1395         gboolean result;
1396         GeeArrayList* self;
1397         self = (GeeArrayList*) base;
1398         result = FALSE;
1399         return result;
1400 }
1401
1402
1403 GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target) {
1404         GeeEqualDataFunc result;
1405         GeeEqualDataFunc _tmp0_;
1406         void* _tmp0__target;
1407         GeeEqualDataFunc _tmp1_;
1408         void* _tmp1__target;
1409         g_return_val_if_fail (self != NULL, NULL);
1410         _tmp0_ = self->priv->_equal_func;
1411         _tmp0__target = self->priv->_equal_func_target;
1412         _tmp1_ = _tmp0_;
1413         _tmp1__target = _tmp0__target;
1414         *result_target = _tmp1__target;
1415         result = _tmp1_;
1416         return result;
1417 }
1418
1419
1420 static void gee_array_list_set_equal_func (GeeArrayList* self, GeeEqualDataFunc value, gpointer value_target) {
1421         GeeEqualDataFunc _tmp0_;
1422         void* _tmp0__target;
1423         g_return_if_fail (self != NULL);
1424         _tmp0_ = value;
1425         _tmp0__target = value_target;
1426         (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL);
1427         self->priv->_equal_func = NULL;
1428         self->priv->_equal_func_target = NULL;
1429         self->priv->_equal_func_target_destroy_notify = NULL;
1430         self->priv->_equal_func = _tmp0_;
1431         self->priv->_equal_func_target = _tmp0__target;
1432         self->priv->_equal_func_target_destroy_notify = NULL;
1433 }
1434
1435
1436 static gpointer _g_object_ref0 (gpointer self) {
1437         return self ? g_object_ref (self) : NULL;
1438 }
1439
1440
1441 static GeeArrayListIterator* gee_array_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list) {
1442         GeeArrayListIterator * self = NULL;
1443         GeeArrayList* _tmp0_;
1444         GeeArrayList* _tmp1_;
1445         GeeArrayList* _tmp2_;
1446         gint _tmp3_;
1447         g_return_val_if_fail (list != NULL, NULL);
1448         self = (GeeArrayListIterator*) g_object_new (object_type, NULL);
1449         self->priv->g_type = g_type;
1450         self->priv->g_dup_func = g_dup_func;
1451         self->priv->g_destroy_func = g_destroy_func;
1452         _tmp0_ = list;
1453         _tmp1_ = _g_object_ref0 (_tmp0_);
1454         _g_object_unref0 (self->priv->_list);
1455         self->priv->_list = _tmp1_;
1456         _tmp2_ = self->priv->_list;
1457         _tmp3_ = _tmp2_->priv->_stamp;
1458         self->priv->_stamp = _tmp3_;
1459         return self;
1460 }
1461
1462
1463 static GeeArrayListIterator* gee_array_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list) {
1464         return gee_array_list_iterator_construct (GEE_ARRAY_LIST_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, list);
1465 }
1466
1467
1468 static gboolean gee_array_list_iterator_real_next (GeeIterator* base) {
1469         GeeArrayListIterator * self;
1470         gboolean result = FALSE;
1471         gint _tmp0_;
1472         GeeArrayList* _tmp1_;
1473         gint _tmp2_;
1474         gint _tmp3_;
1475         GeeArrayList* _tmp4_;
1476         gint _tmp5_;
1477         self = (GeeArrayListIterator*) base;
1478         _tmp0_ = self->priv->_stamp;
1479         _tmp1_ = self->priv->_list;
1480         _tmp2_ = _tmp1_->priv->_stamp;
1481         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1482         _tmp3_ = self->priv->_index;
1483         _tmp4_ = self->priv->_list;
1484         _tmp5_ = _tmp4_->_size;
1485         if ((_tmp3_ + 1) < _tmp5_) {
1486                 gint _tmp6_;
1487                 _tmp6_ = self->priv->_index;
1488                 self->priv->_index = _tmp6_ + 1;
1489                 self->priv->_removed = FALSE;
1490                 result = TRUE;
1491                 return result;
1492         }
1493         result = FALSE;
1494         return result;
1495 }
1496
1497
1498 static gboolean gee_array_list_iterator_real_has_next (GeeIterator* base) {
1499         GeeArrayListIterator * self;
1500         gboolean result = FALSE;
1501         gint _tmp0_;
1502         GeeArrayList* _tmp1_;
1503         gint _tmp2_;
1504         gint _tmp3_;
1505         GeeArrayList* _tmp4_;
1506         gint _tmp5_;
1507         self = (GeeArrayListIterator*) base;
1508         _tmp0_ = self->priv->_stamp;
1509         _tmp1_ = self->priv->_list;
1510         _tmp2_ = _tmp1_->priv->_stamp;
1511         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1512         _tmp3_ = self->priv->_index;
1513         _tmp4_ = self->priv->_list;
1514         _tmp5_ = _tmp4_->_size;
1515         result = (_tmp3_ + 1) < _tmp5_;
1516         return result;
1517 }
1518
1519
1520 static gboolean gee_array_list_iterator_real_first (GeeBidirIterator* base) {
1521         GeeArrayListIterator * self;
1522         gboolean result = FALSE;
1523         gint _tmp0_;
1524         GeeArrayList* _tmp1_;
1525         gint _tmp2_;
1526         GeeArrayList* _tmp3_;
1527         gint _tmp4_;
1528         gint _tmp5_;
1529         self = (GeeArrayListIterator*) base;
1530         _tmp0_ = self->priv->_stamp;
1531         _tmp1_ = self->priv->_list;
1532         _tmp2_ = _tmp1_->priv->_stamp;
1533         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1534         _tmp3_ = self->priv->_list;
1535         _tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp3_);
1536         _tmp5_ = _tmp4_;
1537         if (_tmp5_ == 0) {
1538                 result = FALSE;
1539                 return result;
1540         }
1541         self->priv->_index = 0;
1542         self->priv->_removed = FALSE;
1543         result = TRUE;
1544         return result;
1545 }
1546
1547
1548 static gpointer gee_array_list_iterator_real_get (GeeIterator* base) {
1549         GeeArrayListIterator * self;
1550         gpointer result = NULL;
1551         gint _tmp0_;
1552         GeeArrayList* _tmp1_;
1553         gint _tmp2_;
1554         gint _tmp3_;
1555         gint _tmp4_;
1556         GeeArrayList* _tmp5_;
1557         gint _tmp6_;
1558         gboolean _tmp7_;
1559         GeeArrayList* _tmp8_;
1560         gpointer* _tmp9_;
1561         gint _tmp9__length1;
1562         gint _tmp10_;
1563         gconstpointer _tmp11_;
1564         gpointer _tmp12_;
1565         self = (GeeArrayListIterator*) base;
1566         _tmp0_ = self->priv->_stamp;
1567         _tmp1_ = self->priv->_list;
1568         _tmp2_ = _tmp1_->priv->_stamp;
1569         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1570         _tmp3_ = self->priv->_index;
1571         _vala_assert (_tmp3_ >= 0, "_index >= 0");
1572         _tmp4_ = self->priv->_index;
1573         _tmp5_ = self->priv->_list;
1574         _tmp6_ = _tmp5_->_size;
1575         _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1576         _tmp7_ = self->priv->_removed;
1577         _vala_assert (!_tmp7_, "! _removed");
1578         _tmp8_ = self->priv->_list;
1579         _tmp9_ = _tmp8_->_items;
1580         _tmp9__length1 = _tmp8_->_items_length1;
1581         _tmp10_ = self->priv->_index;
1582         _tmp11_ = _tmp9_[_tmp10_];
1583         _tmp12_ = ((_tmp11_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_);
1584         result = _tmp12_;
1585         return result;
1586 }
1587
1588
1589 static void gee_array_list_iterator_real_remove (GeeIterator* base) {
1590         GeeArrayListIterator * self;
1591         gint _tmp0_;
1592         GeeArrayList* _tmp1_;
1593         gint _tmp2_;
1594         gint _tmp3_;
1595         gint _tmp4_;
1596         GeeArrayList* _tmp5_;
1597         gint _tmp6_;
1598         gboolean _tmp7_;
1599         GeeArrayList* _tmp8_;
1600         gint _tmp9_;
1601         gpointer _tmp10_ = NULL;
1602         gpointer _tmp11_;
1603         gint _tmp12_;
1604         GeeArrayList* _tmp13_;
1605         gint _tmp14_;
1606         self = (GeeArrayListIterator*) base;
1607         _tmp0_ = self->priv->_stamp;
1608         _tmp1_ = self->priv->_list;
1609         _tmp2_ = _tmp1_->priv->_stamp;
1610         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1611         _tmp3_ = self->priv->_index;
1612         _vala_assert (_tmp3_ >= 0, "_index >= 0");
1613         _tmp4_ = self->priv->_index;
1614         _tmp5_ = self->priv->_list;
1615         _tmp6_ = _tmp5_->_size;
1616         _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1617         _tmp7_ = self->priv->_removed;
1618         _vala_assert (!_tmp7_, "! _removed");
1619         _tmp8_ = self->priv->_list;
1620         _tmp9_ = self->priv->_index;
1621         _tmp10_ = gee_abstract_list_remove_at ((GeeAbstractList*) _tmp8_, _tmp9_);
1622         _tmp11_ = _tmp10_;
1623         ((_tmp11_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp11_ = (self->priv->g_destroy_func (_tmp11_), NULL));
1624         _tmp12_ = self->priv->_index;
1625         self->priv->_index = _tmp12_ - 1;
1626         self->priv->_removed = TRUE;
1627         _tmp13_ = self->priv->_list;
1628         _tmp14_ = _tmp13_->priv->_stamp;
1629         self->priv->_stamp = _tmp14_;
1630 }
1631
1632
1633 static gboolean gee_array_list_iterator_real_previous (GeeBidirIterator* base) {
1634         GeeArrayListIterator * self;
1635         gboolean result = FALSE;
1636         gint _tmp0_;
1637         GeeArrayList* _tmp1_;
1638         gint _tmp2_;
1639         gint _tmp3_;
1640         self = (GeeArrayListIterator*) base;
1641         _tmp0_ = self->priv->_stamp;
1642         _tmp1_ = self->priv->_list;
1643         _tmp2_ = _tmp1_->priv->_stamp;
1644         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1645         _tmp3_ = self->priv->_index;
1646         if (_tmp3_ > 0) {
1647                 gint _tmp4_;
1648                 _tmp4_ = self->priv->_index;
1649                 self->priv->_index = _tmp4_ - 1;
1650                 result = TRUE;
1651                 return result;
1652         }
1653         result = FALSE;
1654         return result;
1655 }
1656
1657
1658 static gboolean gee_array_list_iterator_real_has_previous (GeeBidirIterator* base) {
1659         GeeArrayListIterator * self;
1660         gboolean result = FALSE;
1661         gint _tmp0_;
1662         GeeArrayList* _tmp1_;
1663         gint _tmp2_;
1664         gint _tmp3_;
1665         self = (GeeArrayListIterator*) base;
1666         _tmp0_ = self->priv->_stamp;
1667         _tmp1_ = self->priv->_list;
1668         _tmp2_ = _tmp1_->priv->_stamp;
1669         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1670         _tmp3_ = self->priv->_index;
1671         result = (_tmp3_ - 1) >= 0;
1672         return result;
1673 }
1674
1675
1676 static gboolean gee_array_list_iterator_real_last (GeeBidirIterator* base) {
1677         GeeArrayListIterator * self;
1678         gboolean result = FALSE;
1679         gint _tmp0_;
1680         GeeArrayList* _tmp1_;
1681         gint _tmp2_;
1682         GeeArrayList* _tmp3_;
1683         gint _tmp4_;
1684         gint _tmp5_;
1685         GeeArrayList* _tmp6_;
1686         gint _tmp7_;
1687         self = (GeeArrayListIterator*) base;
1688         _tmp0_ = self->priv->_stamp;
1689         _tmp1_ = self->priv->_list;
1690         _tmp2_ = _tmp1_->priv->_stamp;
1691         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1692         _tmp3_ = self->priv->_list;
1693         _tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp3_);
1694         _tmp5_ = _tmp4_;
1695         if (_tmp5_ == 0) {
1696                 result = FALSE;
1697                 return result;
1698         }
1699         _tmp6_ = self->priv->_list;
1700         _tmp7_ = _tmp6_->_size;
1701         self->priv->_index = _tmp7_ - 1;
1702         result = TRUE;
1703         return result;
1704 }
1705
1706
1707 static void gee_array_list_iterator_real_set (GeeListIterator* base, gconstpointer item) {
1708         GeeArrayListIterator * self;
1709         gint _tmp0_;
1710         GeeArrayList* _tmp1_;
1711         gint _tmp2_;
1712         gint _tmp3_;
1713         gint _tmp4_;
1714         GeeArrayList* _tmp5_;
1715         gint _tmp6_;
1716         GeeArrayList* _tmp7_;
1717         gpointer* _tmp8_;
1718         gint _tmp8__length1;
1719         gint _tmp9_;
1720         gconstpointer _tmp10_;
1721         gpointer _tmp11_;
1722         gpointer _tmp12_;
1723         GeeArrayList* _tmp13_;
1724         GeeArrayList* _tmp14_;
1725         gint _tmp15_;
1726         gint _tmp16_;
1727         self = (GeeArrayListIterator*) base;
1728         _tmp0_ = self->priv->_stamp;
1729         _tmp1_ = self->priv->_list;
1730         _tmp2_ = _tmp1_->priv->_stamp;
1731         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1732         _tmp3_ = self->priv->_index;
1733         _vala_assert (_tmp3_ >= 0, "_index >= 0");
1734         _tmp4_ = self->priv->_index;
1735         _tmp5_ = self->priv->_list;
1736         _tmp6_ = _tmp5_->_size;
1737         _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1738         _tmp7_ = self->priv->_list;
1739         _tmp8_ = _tmp7_->_items;
1740         _tmp8__length1 = _tmp7_->_items_length1;
1741         _tmp9_ = self->priv->_index;
1742         _tmp10_ = item;
1743         _tmp11_ = ((_tmp10_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_);
1744         ((_tmp8_[_tmp9_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp8_[_tmp9_] = (self->priv->g_destroy_func (_tmp8_[_tmp9_]), NULL));
1745         _tmp8_[_tmp9_] = _tmp11_;
1746         _tmp12_ = _tmp8_[_tmp9_];
1747         _tmp13_ = self->priv->_list;
1748         _tmp14_ = self->priv->_list;
1749         _tmp15_ = _tmp14_->priv->_stamp;
1750         _tmp14_->priv->_stamp = _tmp15_ + 1;
1751         _tmp16_ = _tmp14_->priv->_stamp;
1752         self->priv->_stamp = _tmp16_;
1753 }
1754
1755
1756 static void gee_array_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item) {
1757         GeeArrayListIterator * self;
1758         gint _tmp0_;
1759         GeeArrayList* _tmp1_;
1760         gint _tmp2_;
1761         gint _tmp3_;
1762         gint _tmp4_;
1763         GeeArrayList* _tmp5_;
1764         gint _tmp6_;
1765         GeeArrayList* _tmp7_;
1766         gint _tmp8_;
1767         gconstpointer _tmp9_;
1768         gint _tmp10_;
1769         GeeArrayList* _tmp11_;
1770         gint _tmp12_;
1771         self = (GeeArrayListIterator*) base;
1772         _tmp0_ = self->priv->_stamp;
1773         _tmp1_ = self->priv->_list;
1774         _tmp2_ = _tmp1_->priv->_stamp;
1775         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1776         _tmp3_ = self->priv->_index;
1777         _vala_assert (_tmp3_ >= 0, "_index >= 0");
1778         _tmp4_ = self->priv->_index;
1779         _tmp5_ = self->priv->_list;
1780         _tmp6_ = _tmp5_->_size;
1781         _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1782         _tmp7_ = self->priv->_list;
1783         _tmp8_ = self->priv->_index;
1784         _tmp9_ = item;
1785         gee_abstract_list_insert ((GeeAbstractList*) _tmp7_, _tmp8_, _tmp9_);
1786         _tmp10_ = self->priv->_index;
1787         self->priv->_index = _tmp10_ + 1;
1788         _tmp11_ = self->priv->_list;
1789         _tmp12_ = _tmp11_->priv->_stamp;
1790         self->priv->_stamp = _tmp12_;
1791 }
1792
1793
1794 static void gee_array_list_iterator_real_add (GeeListIterator* base, gconstpointer item) {
1795         GeeArrayListIterator * self;
1796         gint _tmp0_;
1797         GeeArrayList* _tmp1_;
1798         gint _tmp2_;
1799         gint _tmp3_;
1800         gint _tmp4_;
1801         GeeArrayList* _tmp5_;
1802         gint _tmp6_;
1803         GeeArrayList* _tmp7_;
1804         gint _tmp8_;
1805         gconstpointer _tmp9_;
1806         gint _tmp10_;
1807         GeeArrayList* _tmp11_;
1808         gint _tmp12_;
1809         self = (GeeArrayListIterator*) base;
1810         _tmp0_ = self->priv->_stamp;
1811         _tmp1_ = self->priv->_list;
1812         _tmp2_ = _tmp1_->priv->_stamp;
1813         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1814         _tmp3_ = self->priv->_index;
1815         _vala_assert (_tmp3_ >= 0, "_index >= 0");
1816         _tmp4_ = self->priv->_index;
1817         _tmp5_ = self->priv->_list;
1818         _tmp6_ = _tmp5_->_size;
1819         _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1820         _tmp7_ = self->priv->_list;
1821         _tmp8_ = self->priv->_index;
1822         _tmp9_ = item;
1823         gee_abstract_list_insert ((GeeAbstractList*) _tmp7_, _tmp8_ + 1, _tmp9_);
1824         _tmp10_ = self->priv->_index;
1825         self->priv->_index = _tmp10_ + 1;
1826         _tmp11_ = self->priv->_list;
1827         _tmp12_ = _tmp11_->priv->_stamp;
1828         self->priv->_stamp = _tmp12_;
1829 }
1830
1831
1832 static gint gee_array_list_iterator_real_index (GeeListIterator* base) {
1833         GeeArrayListIterator * self;
1834         gint result = 0;
1835         gint _tmp0_;
1836         GeeArrayList* _tmp1_;
1837         gint _tmp2_;
1838         gint _tmp3_;
1839         gint _tmp4_;
1840         GeeArrayList* _tmp5_;
1841         gint _tmp6_;
1842         gint _tmp7_;
1843         self = (GeeArrayListIterator*) base;
1844         _tmp0_ = self->priv->_stamp;
1845         _tmp1_ = self->priv->_list;
1846         _tmp2_ = _tmp1_->priv->_stamp;
1847         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1848         _tmp3_ = self->priv->_index;
1849         _vala_assert (_tmp3_ >= 0, "_index >= 0");
1850         _tmp4_ = self->priv->_index;
1851         _tmp5_ = self->priv->_list;
1852         _tmp6_ = _tmp5_->_size;
1853         _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1854         _tmp7_ = self->priv->_index;
1855         result = _tmp7_;
1856         return result;
1857 }
1858
1859
1860 static gboolean gee_array_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
1861         GeeArrayListIterator * self;
1862         gboolean result = FALSE;
1863         gint _tmp0_;
1864         GeeArrayList* _tmp1_;
1865         gint _tmp2_;
1866         gboolean _tmp3_ = FALSE;
1867         gint _tmp4_;
1868         gboolean _tmp6_;
1869         GeeArrayList* _tmp19_;
1870         gint _tmp20_;
1871         self = (GeeArrayListIterator*) base;
1872         _tmp0_ = self->priv->_stamp;
1873         _tmp1_ = self->priv->_list;
1874         _tmp2_ = _tmp1_->priv->_stamp;
1875         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1876         _tmp4_ = self->priv->_index;
1877         if (_tmp4_ < 0) {
1878                 _tmp3_ = TRUE;
1879         } else {
1880                 gboolean _tmp5_;
1881                 _tmp5_ = self->priv->_removed;
1882                 _tmp3_ = _tmp5_;
1883         }
1884         _tmp6_ = _tmp3_;
1885         if (_tmp6_) {
1886                 gint _tmp7_;
1887                 _tmp7_ = self->priv->_index;
1888                 self->priv->_index = _tmp7_ + 1;
1889         }
1890         while (TRUE) {
1891                 gint _tmp8_;
1892                 GeeArrayList* _tmp9_;
1893                 gint _tmp10_;
1894                 GeeForallFunc _tmp11_;
1895                 void* _tmp11__target;
1896                 GeeArrayList* _tmp12_;
1897                 gpointer* _tmp13_;
1898                 gint _tmp13__length1;
1899                 gint _tmp14_;
1900                 gconstpointer _tmp15_;
1901                 gpointer _tmp16_;
1902                 gboolean _tmp17_ = FALSE;
1903                 gint _tmp18_;
1904                 _tmp8_ = self->priv->_index;
1905                 _tmp9_ = self->priv->_list;
1906                 _tmp10_ = _tmp9_->_size;
1907                 if (!(_tmp8_ < _tmp10_)) {
1908                         break;
1909                 }
1910                 _tmp11_ = f;
1911                 _tmp11__target = f_target;
1912                 _tmp12_ = self->priv->_list;
1913                 _tmp13_ = _tmp12_->_items;
1914                 _tmp13__length1 = _tmp12_->_items_length1;
1915                 _tmp14_ = self->priv->_index;
1916                 _tmp15_ = _tmp13_[_tmp14_];
1917                 _tmp16_ = ((_tmp15_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp15_) : ((gpointer) _tmp15_);
1918                 _tmp17_ = _tmp11_ (_tmp16_, _tmp11__target);
1919                 if (!_tmp17_) {
1920                         result = FALSE;
1921                         return result;
1922                 }
1923                 _tmp18_ = self->priv->_index;
1924                 self->priv->_index = _tmp18_ + 1;
1925         }
1926         _tmp19_ = self->priv->_list;
1927         _tmp20_ = _tmp19_->_size;
1928         self->priv->_index = _tmp20_ - 1;
1929         result = TRUE;
1930         return result;
1931 }
1932
1933
1934 static gboolean gee_array_list_iterator_real_get_read_only (GeeIterator* base) {
1935         gboolean result;
1936         GeeArrayListIterator* self;
1937         self = (GeeArrayListIterator*) base;
1938         result = FALSE;
1939         return result;
1940 }
1941
1942
1943 static gboolean gee_array_list_iterator_real_get_valid (GeeIterator* base) {
1944         gboolean result;
1945         GeeArrayListIterator* self;
1946         gboolean _tmp0_ = FALSE;
1947         gboolean _tmp1_ = FALSE;
1948         gint _tmp2_;
1949         gboolean _tmp6_;
1950         gboolean _tmp8_;
1951         self = (GeeArrayListIterator*) base;
1952         _tmp2_ = self->priv->_index;
1953         if (_tmp2_ >= 0) {
1954                 gint _tmp3_;
1955                 GeeArrayList* _tmp4_;
1956                 gint _tmp5_;
1957                 _tmp3_ = self->priv->_index;
1958                 _tmp4_ = self->priv->_list;
1959                 _tmp5_ = _tmp4_->_size;
1960                 _tmp1_ = _tmp3_ < _tmp5_;
1961         } else {
1962                 _tmp1_ = FALSE;
1963         }
1964         _tmp6_ = _tmp1_;
1965         if (_tmp6_) {
1966                 gboolean _tmp7_;
1967                 _tmp7_ = self->priv->_removed;
1968                 _tmp0_ = !_tmp7_;
1969         } else {
1970                 _tmp0_ = FALSE;
1971         }
1972         _tmp8_ = _tmp0_;
1973         result = _tmp8_;
1974         return result;
1975 }
1976
1977
1978 static void gee_array_list_iterator_class_init (GeeArrayListIteratorClass * klass) {
1979         gee_array_list_iterator_parent_class = g_type_class_peek_parent (klass);
1980         g_type_class_add_private (klass, sizeof (GeeArrayListIteratorPrivate));
1981         G_OBJECT_CLASS (klass)->get_property = _vala_gee_array_list_iterator_get_property;
1982         G_OBJECT_CLASS (klass)->set_property = _vala_gee_array_list_iterator_set_property;
1983         G_OBJECT_CLASS (klass)->finalize = gee_array_list_iterator_finalize;
1984         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1985         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1986         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1987         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1988         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1989 }
1990
1991
1992 static GType gee_array_list_iterator_gee_traversable_get_g_type (GeeArrayListIterator* self) {
1993         return self->priv->g_type;
1994 }
1995
1996
1997 static GBoxedCopyFunc gee_array_list_iterator_gee_traversable_get_g_dup_func (GeeArrayListIterator* self) {
1998         return self->priv->g_dup_func;
1999 }
2000
2001
2002 static GDestroyNotify gee_array_list_iterator_gee_traversable_get_g_destroy_func (GeeArrayListIterator* self) {
2003         return self->priv->g_destroy_func;
2004 }
2005
2006
2007 static void gee_array_list_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
2008         gee_array_list_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
2009         iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_array_list_iterator_real_foreach;
2010         iface->get_g_type = (GType(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_type;
2011         iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_dup_func;
2012         iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_destroy_func;
2013 }
2014
2015
2016 static void gee_array_list_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
2017         gee_array_list_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
2018         iface->next = (gboolean (*)(GeeIterator*)) gee_array_list_iterator_real_next;
2019         iface->has_next = (gboolean (*)(GeeIterator*)) gee_array_list_iterator_real_has_next;
2020         iface->get = (gpointer (*)(GeeIterator*)) gee_array_list_iterator_real_get;
2021         iface->remove = (void (*)(GeeIterator*)) gee_array_list_iterator_real_remove;
2022         iface->get_read_only = gee_array_list_iterator_real_get_read_only;
2023         iface->get_valid = gee_array_list_iterator_real_get_valid;
2024 }
2025
2026
2027 static GType gee_array_list_iterator_gee_bidir_iterator_get_g_type (GeeArrayListIterator* self) {
2028         return self->priv->g_type;
2029 }
2030
2031
2032 static GBoxedCopyFunc gee_array_list_iterator_gee_bidir_iterator_get_g_dup_func (GeeArrayListIterator* self) {
2033         return self->priv->g_dup_func;
2034 }
2035
2036
2037 static GDestroyNotify gee_array_list_iterator_gee_bidir_iterator_get_g_destroy_func (GeeArrayListIterator* self) {
2038         return self->priv->g_destroy_func;
2039 }
2040
2041
2042 static void gee_array_list_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) {
2043         gee_array_list_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface);
2044         iface->first = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_first;
2045         iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_previous;
2046         iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_has_previous;
2047         iface->last = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_last;
2048         iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_type;
2049         iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_dup_func;
2050         iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_destroy_func;
2051 }
2052
2053
2054 static void gee_array_list_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface) {
2055         gee_array_list_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface);
2056         iface->set = (void (*)(GeeListIterator*, gconstpointer)) gee_array_list_iterator_real_set;
2057         iface->add = (void (*)(GeeListIterator*, gconstpointer)) gee_array_list_iterator_real_add;
2058         iface->index = (gint (*)(GeeListIterator*)) gee_array_list_iterator_real_index;
2059 }
2060
2061
2062 static GType gee_array_list_iterator_gee_bidir_list_iterator_get_g_type (GeeArrayListIterator* self) {
2063         return self->priv->g_type;
2064 }
2065
2066
2067 static GBoxedCopyFunc gee_array_list_iterator_gee_bidir_list_iterator_get_g_dup_func (GeeArrayListIterator* self) {
2068         return self->priv->g_dup_func;
2069 }
2070
2071
2072 static GDestroyNotify gee_array_list_iterator_gee_bidir_list_iterator_get_g_destroy_func (GeeArrayListIterator* self) {
2073         return self->priv->g_destroy_func;
2074 }
2075
2076
2077 static void gee_array_list_iterator_gee_bidir_list_iterator_interface_init (GeeBidirListIteratorIface * iface) {
2078         gee_array_list_iterator_gee_bidir_list_iterator_parent_iface = g_type_interface_peek_parent (iface);
2079         iface->insert = (void (*)(GeeBidirListIterator*, gconstpointer)) gee_array_list_iterator_real_insert;
2080         iface->get_g_type = (GType(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_type;
2081         iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_dup_func;
2082         iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_destroy_func;
2083 }
2084
2085
2086 static void gee_array_list_iterator_instance_init (GeeArrayListIterator * self) {
2087         self->priv = GEE_ARRAY_LIST_ITERATOR_GET_PRIVATE (self);
2088         self->priv->_index = -1;
2089         self->priv->_removed = FALSE;
2090         self->priv->_stamp = 0;
2091 }
2092
2093
2094 static void gee_array_list_iterator_finalize (GObject* obj) {
2095         GeeArrayListIterator * self;
2096         self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator);
2097         _g_object_unref0 (self->priv->_list);
2098         G_OBJECT_CLASS (gee_array_list_iterator_parent_class)->finalize (obj);
2099 }
2100
2101
2102 static GType gee_array_list_iterator_get_type (void) {
2103         static volatile gsize gee_array_list_iterator_type_id__volatile = 0;
2104         if (g_once_init_enter (&gee_array_list_iterator_type_id__volatile)) {
2105                 static const GTypeInfo g_define_type_info = { sizeof (GeeArrayListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayListIterator), 0, (GInstanceInitFunc) gee_array_list_iterator_instance_init, NULL };
2106                 static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2107                 static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2108                 static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2109                 static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2110                 static const GInterfaceInfo gee_bidir_list_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_bidir_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2111                 GType gee_array_list_iterator_type_id;
2112                 gee_array_list_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeArrayListIterator", &g_define_type_info, 0);
2113                 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
2114                 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
2115                 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info);
2116                 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info);
2117                 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_BIDIR_LIST_ITERATOR, &gee_bidir_list_iterator_info);
2118                 g_once_init_leave (&gee_array_list_iterator_type_id__volatile, gee_array_list_iterator_type_id);
2119         }
2120         return gee_array_list_iterator_type_id__volatile;
2121 }
2122
2123
2124 static void _vala_gee_array_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
2125         GeeArrayListIterator * self;
2126         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator);
2127         switch (property_id) {
2128                 case GEE_ARRAY_LIST_ITERATOR_READ_ONLY:
2129                 g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
2130                 break;
2131                 case GEE_ARRAY_LIST_ITERATOR_VALID:
2132                 g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
2133                 break;
2134                 default:
2135                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2136                 break;
2137         }
2138 }
2139
2140
2141 static void _vala_gee_array_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
2142         GeeArrayListIterator * self;
2143         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator);
2144         switch (property_id) {
2145                 case GEE_ARRAY_LIST_ITERATOR_G_TYPE:
2146                 self->priv->g_type = g_value_get_gtype (value);
2147                 break;
2148                 case GEE_ARRAY_LIST_ITERATOR_G_DUP_FUNC:
2149                 self->priv->g_dup_func = g_value_get_pointer (value);
2150                 break;
2151                 case GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC:
2152                 self->priv->g_destroy_func = g_value_get_pointer (value);
2153                 break;
2154                 default:
2155                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2156                 break;
2157         }
2158 }
2159
2160
2161 static void gee_array_list_class_init (GeeArrayListClass * klass) {
2162         gee_array_list_parent_class = g_type_class_peek_parent (klass);
2163         g_type_class_add_private (klass, sizeof (GeeArrayListPrivate));
2164         GEE_ABSTRACT_COLLECTION_CLASS (klass)->foreach = gee_array_list_real_foreach;
2165         GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_array_list_real_iterator;
2166         GEE_ABSTRACT_LIST_CLASS (klass)->list_iterator = gee_array_list_real_list_iterator;
2167         GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->bidir_list_iterator = gee_array_list_real_bidir_list_iterator;
2168         GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_array_list_real_contains;
2169         GEE_ABSTRACT_LIST_CLASS (klass)->index_of = gee_array_list_real_index_of;
2170         GEE_ABSTRACT_LIST_CLASS (klass)->get = gee_array_list_real_get;
2171         GEE_ABSTRACT_LIST_CLASS (klass)->set = gee_array_list_real_set;
2172         GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_array_list_real_add;
2173         GEE_ABSTRACT_LIST_CLASS (klass)->insert = gee_array_list_real_insert;
2174         GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_array_list_real_remove;
2175         GEE_ABSTRACT_LIST_CLASS (klass)->remove_at = gee_array_list_real_remove_at;
2176         GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_array_list_real_clear;
2177         GEE_ABSTRACT_LIST_CLASS (klass)->slice = gee_array_list_real_slice;
2178         GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_array_list_real_get_size;
2179         GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_array_list_real_get_read_only;
2180         G_OBJECT_CLASS (klass)->get_property = _vala_gee_array_list_get_property;
2181         G_OBJECT_CLASS (klass)->set_property = _vala_gee_array_list_set_property;
2182         G_OBJECT_CLASS (klass)->finalize = gee_array_list_finalize;
2183         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
2184         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
2185         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
2186         /**
2187          * {@inheritDoc}
2188          */
2189         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
2190         /**
2191          * {@inheritDoc}
2192          */
2193         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
2194 }
2195
2196
2197 static void gee_array_list_instance_init (GeeArrayList * self) {
2198         self->priv = GEE_ARRAY_LIST_GET_PRIVATE (self);
2199         self->priv->_stamp = 0;
2200 }
2201
2202
2203 static void gee_array_list_finalize (GObject* obj) {
2204         GeeArrayList * self;
2205         self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ARRAY_LIST, GeeArrayList);
2206         (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL);
2207         self->priv->_equal_func = NULL;
2208         self->priv->_equal_func_target = NULL;
2209         self->priv->_equal_func_target_destroy_notify = NULL;
2210         self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL);
2211         G_OBJECT_CLASS (gee_array_list_parent_class)->finalize (obj);
2212 }
2213
2214
2215 /**
2216  * Resizable array implementation of the {@link List} interface.
2217  *
2218  * The storage array grows automatically when needed.
2219  *
2220  * This implementation is pretty good for rarely modified data. Because they are
2221  * stored in an array this structure does not fit for highly mutable data. For an
2222  * alternative implementation see {@link LinkedList}.
2223  *
2224  * @see LinkedList
2225  */
2226 GType gee_array_list_get_type (void) {
2227         static volatile gsize gee_array_list_type_id__volatile = 0;
2228         if (g_once_init_enter (&gee_array_list_type_id__volatile)) {
2229                 static const GTypeInfo g_define_type_info = { sizeof (GeeArrayListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayList), 0, (GInstanceInitFunc) gee_array_list_instance_init, NULL };
2230                 GType gee_array_list_type_id;
2231                 gee_array_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_LIST, "GeeArrayList", &g_define_type_info, 0);
2232                 g_once_init_leave (&gee_array_list_type_id__volatile, gee_array_list_type_id);
2233         }
2234         return gee_array_list_type_id__volatile;
2235 }
2236
2237
2238 static void _vala_gee_array_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
2239         GeeArrayList * self;
2240         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ARRAY_LIST, GeeArrayList);
2241         switch (property_id) {
2242                 case GEE_ARRAY_LIST_SIZE:
2243                 g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
2244                 break;
2245                 case GEE_ARRAY_LIST_READ_ONLY:
2246                 g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
2247                 break;
2248                 default:
2249                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2250                 break;
2251         }
2252 }
2253
2254
2255 static void _vala_gee_array_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
2256         GeeArrayList * self;
2257         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ARRAY_LIST, GeeArrayList);
2258         switch (property_id) {
2259                 case GEE_ARRAY_LIST_G_TYPE:
2260                 self->priv->g_type = g_value_get_gtype (value);
2261                 break;
2262                 case GEE_ARRAY_LIST_G_DUP_FUNC:
2263                 self->priv->g_dup_func = g_value_get_pointer (value);
2264                 break;
2265                 case GEE_ARRAY_LIST_G_DESTROY_FUNC:
2266                 self->priv->g_destroy_func = g_value_get_pointer (value);
2267                 break;
2268                 default:
2269                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2270                 break;
2271         }
2272 }
2273
2274
2275 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2276         if ((array != NULL) && (destroy_func != NULL)) {
2277                 int i;
2278                 for (i = 0; i < array_length; i = i + 1) {
2279                         if (((gpointer*) array)[i] != NULL) {
2280                                 destroy_func (((gpointer*) array)[i]);
2281                         }
2282                 }
2283         }
2284 }
2285
2286
2287 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2288         _vala_array_destroy (array, array_length, destroy_func);
2289         g_free (array);
2290 }
2291
2292
2293 static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length) {
2294         g_memmove (((char*) array) + (dest * element_size), ((char*) array) + (src * element_size), length * element_size);
2295         if ((src < dest) && ((src + length) > dest)) {
2296                 memset (((char*) array) + (src * element_size), 0, (dest - src) * element_size);
2297         } else if ((src > dest) && (src < (dest + length))) {
2298                 memset (((char*) array) + ((dest + length) * element_size), 0, (src - dest) * element_size);
2299         } else if (src != dest) {
2300                 memset (((char*) array) + (src * element_size), 0, length * element_size);
2301         }
2302 }
2303
2304
2305