Update Changelog
[profile/ivi/libgee.git] / gee / collection.c
1 /* collection.c generated by valac 0.18.0, the Vala compiler
2  * generated from collection.vala, do not modify */
3
4 /* collection.vala
5  *
6  * Copyright (C) 2007-2009  Jürg Billeter
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
21  *
22  * Author:
23  *      Jürg Billeter <j@bitron.ch>
24  */
25
26 #include <glib.h>
27 #include <glib-object.h>
28 #include <float.h>
29 #include <math.h>
30 #include <string.h>
31
32
33 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
34 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
35 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
36 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
37
38 typedef struct _GeeTraversable GeeTraversable;
39 typedef struct _GeeTraversableIface GeeTraversableIface;
40
41 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
42
43 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
44 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
45 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
46 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
47 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
48 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
49
50 typedef struct _GeeLazy GeeLazy;
51 typedef struct _GeeLazyClass GeeLazyClass;
52
53 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
54 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
55 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
56 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
57
58 typedef struct _GeeIterator GeeIterator;
59 typedef struct _GeeIteratorIface GeeIteratorIface;
60
61 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
62 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
63 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
64 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
65
66 typedef struct _GeeIterable GeeIterable;
67 typedef struct _GeeIterableIface GeeIterableIface;
68
69 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
70 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
71 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
72 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
73
74 typedef struct _GeeCollection GeeCollection;
75 typedef struct _GeeCollectionIface GeeCollectionIface;
76 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
77 #define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
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
89 #define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ())
90 #define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet))
91 #define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))
92 #define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET))
93 #define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET))
94 #define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))
95
96 typedef struct _GeeAbstractSet GeeAbstractSet;
97 typedef struct _GeeAbstractSetClass GeeAbstractSetClass;
98
99 #define GEE_TYPE_HASH_SET (gee_hash_set_get_type ())
100 #define GEE_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_SET, GeeHashSet))
101 #define GEE_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_SET, GeeHashSetClass))
102 #define GEE_IS_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_SET))
103 #define GEE_IS_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_SET))
104 #define GEE_HASH_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_SET, GeeHashSetClass))
105
106 typedef struct _GeeHashSet GeeHashSet;
107 typedef struct _GeeHashSetClass GeeHashSetClass;
108
109 #define GEE_TYPE_SET (gee_set_get_type ())
110 #define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
111 #define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
112 #define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))
113
114 typedef struct _GeeSet GeeSet;
115 typedef struct _GeeSetIface GeeSetIface;
116
117 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
118 typedef enum  {
119         GEE_TRAVERSABLE_STREAM_YIELD,
120         GEE_TRAVERSABLE_STREAM_CONTINUE,
121         GEE_TRAVERSABLE_STREAM_END
122 } GeeTraversableStream;
123
124 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
125 struct _GeeIteratorIface {
126         GTypeInterface parent_iface;
127         gboolean (*next) (GeeIterator* self);
128         gboolean (*has_next) (GeeIterator* self);
129         gpointer (*get) (GeeIterator* self);
130         void (*remove) (GeeIterator* self);
131         gboolean (*get_valid) (GeeIterator* self);
132         gboolean (*get_read_only) (GeeIterator* self);
133 };
134
135 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
136 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
137 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
138 struct _GeeTraversableIface {
139         GTypeInterface parent_iface;
140         GType (*get_g_type) (GeeTraversable* self);
141         GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
142         GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
143         gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
144         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);
145         gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
146         GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
147         GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
148         GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
149         GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
150         GType (*get_element_type) (GeeTraversable* self);
151 };
152
153 struct _GeeIterableIface {
154         GTypeInterface parent_iface;
155         GType (*get_g_type) (GeeIterable* self);
156         GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
157         GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
158         GeeIterator* (*iterator) (GeeIterable* self);
159 };
160
161 struct _GeeCollectionIface {
162         GTypeInterface parent_iface;
163         GType (*get_g_type) (GeeCollection* self);
164         GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
165         GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
166         gboolean (*contains) (GeeCollection* self, gconstpointer item);
167         gboolean (*add) (GeeCollection* self, gconstpointer item);
168         gboolean (*remove) (GeeCollection* self, gconstpointer item);
169         void (*clear) (GeeCollection* self);
170         gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
171         gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
172         gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
173         gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
174         gpointer* (*to_array) (GeeCollection* self, int* result_length1);
175         gint (*get_size) (GeeCollection* self);
176         gboolean (*get_is_empty) (GeeCollection* self);
177         gboolean (*get_read_only) (GeeCollection* self);
178         GeeCollection* (*get_read_only_view) (GeeCollection* self);
179 };
180
181 typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data);
182 typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data);
183 struct _GeeSetIface {
184         GTypeInterface parent_iface;
185         GType (*get_g_type) (GeeSet* self);
186         GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
187         GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
188         GeeSet* (*get_read_only_view) (GeeSet* self);
189 };
190
191
192
193 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
194 gpointer gee_lazy_ref (gpointer instance);
195 void gee_lazy_unref (gpointer instance);
196 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
197 void gee_value_set_lazy (GValue* value, gpointer v_object);
198 void gee_value_take_lazy (GValue* value, gpointer v_object);
199 gpointer gee_value_get_lazy (const GValue* value);
200 GType gee_lazy_get_type (void) G_GNUC_CONST;
201 GType gee_iterator_get_type (void) G_GNUC_CONST;
202 GType gee_traversable_get_type (void) G_GNUC_CONST;
203 GType gee_iterable_get_type (void) G_GNUC_CONST;
204 GType gee_collection_get_type (void) G_GNUC_CONST;
205 gboolean gee_collection_contains (GeeCollection* self, gconstpointer item);
206 gboolean gee_collection_add (GeeCollection* self, gconstpointer item);
207 gboolean gee_collection_remove (GeeCollection* self, gconstpointer item);
208 void gee_collection_clear (GeeCollection* self);
209 gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection);
210 static gboolean gee_collection_real_add_all (GeeCollection* self, GeeCollection* collection);
211 gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
212 static gboolean __lambda15_ (GeeCollection* self, gpointer item, gboolean changed);
213 static gpointer ___lambda15__gee_fold_func (gpointer g, gpointer a, gpointer self);
214 gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collection);
215 static gboolean gee_collection_real_contains_all (GeeCollection* self, GeeCollection* collection);
216 gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target);
217 static gboolean __lambda16_ (GeeCollection* self, gpointer item);
218 static gboolean ___lambda16__gee_forall_func (gpointer g, gpointer self);
219 gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection);
220 static gboolean gee_collection_real_remove_all (GeeCollection* self, GeeCollection* collection);
221 static gboolean __lambda17_ (GeeCollection* self, gpointer item, gboolean changed);
222 static gpointer ___lambda17__gee_fold_func (gpointer g, gpointer a, gpointer self);
223 gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection);
224 static gboolean gee_collection_real_retain_all (GeeCollection* self, GeeCollection* collection);
225 GeeIterator* gee_iterable_iterator (GeeIterable* self);
226 gboolean gee_iterator_next (GeeIterator* self);
227 gpointer gee_iterator_get (GeeIterator* self);
228 void gee_iterator_remove (GeeIterator* self);
229 gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1);
230 static gpointer* gee_collection_real_to_array (GeeCollection* self, int* result_length1);
231 static gboolean* gee_collection_to_bool_array (GeeCollection* coll, int* result_length1);
232 static gchar* gee_collection_to_char_array (GeeCollection* coll, int* result_length1);
233 static guchar* gee_collection_to_uchar_array (GeeCollection* coll, int* result_length1);
234 static gint* gee_collection_to_int_array (GeeCollection* coll, int* result_length1);
235 static guint* gee_collection_to_uint_array (GeeCollection* coll, int* result_length1);
236 static gint64* gee_collection_to_int64_array (GeeCollection* coll, int* result_length1);
237 static guint64* gee_collection_to_uint64_array (GeeCollection* coll, int* result_length1);
238 static glong* gee_collection_to_long_array (GeeCollection* coll, int* result_length1);
239 static gulong* gee_collection_to_ulong_array (GeeCollection* coll, int* result_length1);
240 static gfloat** gee_collection_to_float_array (GeeCollection* coll, int* result_length1);
241 static gdouble** gee_collection_to_double_array (GeeCollection* coll, int* result_length1);
242 gint gee_collection_get_size (GeeCollection* self);
243 gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1);
244 gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1);
245 gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1);
246 static gfloat* _float_dup (gfloat* self);
247 static gdouble* _double_dup (gdouble* self);
248 GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
249 GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
250 GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
251 GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
252 GType gee_abstract_set_get_type (void) G_GNUC_CONST;
253 GType gee_hash_set_get_type (void) G_GNUC_CONST;
254 GType gee_set_get_type (void) G_GNUC_CONST;
255 GeeSet* gee_abstract_set_get_read_only_view (GeeAbstractSet* self);
256 gboolean gee_collection_get_is_empty (GeeCollection* self);
257 gboolean gee_collection_get_read_only (GeeCollection* self);
258 GeeCollection* gee_collection_get_read_only_view (GeeCollection* self);
259 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
260 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
261
262
263 /**
264  * Determines whether this collection contains the specified item.
265  *
266  * @param item the item to locate in the collection
267  *
268  * @return     ``true`` if item is found, ``false`` otherwise
269  */
270 gboolean gee_collection_contains (GeeCollection* self, gconstpointer item) {
271         g_return_val_if_fail (self != NULL, FALSE);
272         return GEE_COLLECTION_GET_INTERFACE (self)->contains (self, item);
273 }
274
275
276 /**
277  * Adds an item to this collection. Must not be called on read-only
278  * collections.
279  *
280  * @param item the item to add to the collection
281  *
282  * @return     ``true`` if the collection has been changed, ``false`` otherwise
283  */
284 gboolean gee_collection_add (GeeCollection* self, gconstpointer item) {
285         g_return_val_if_fail (self != NULL, FALSE);
286         return GEE_COLLECTION_GET_INTERFACE (self)->add (self, item);
287 }
288
289
290 /**
291  * Removes the first occurence of an item from this collection. Must not
292  * be called on read-only collections.
293  *
294  * @param item the item to remove from the collection
295  *
296  * @return     ``true`` if the collection has been changed, ``false`` otherwise
297  */
298 gboolean gee_collection_remove (GeeCollection* self, gconstpointer item) {
299         g_return_val_if_fail (self != NULL, FALSE);
300         return GEE_COLLECTION_GET_INTERFACE (self)->remove (self, item);
301 }
302
303
304 /**
305  * Removes all items from this collection. Must not be called on
306  * read-only collections.
307  */
308 void gee_collection_clear (GeeCollection* self) {
309         g_return_if_fail (self != NULL);
310         GEE_COLLECTION_GET_INTERFACE (self)->clear (self);
311 }
312
313
314 /**
315  * Adds all items in the input collection to this collection.
316  *
317  * @param collection the collection which items will be added to this
318  *                   collection.
319  *
320  * @return     ``true`` if the collection has been changed, ``false`` otherwise
321  */
322 static gboolean __lambda15_ (GeeCollection* self, gpointer item, gboolean changed) {
323         gboolean result = FALSE;
324         gboolean _tmp0_;
325         gconstpointer _tmp1_;
326         gboolean _tmp2_ = FALSE;
327         _tmp0_ = changed;
328         _tmp1_ = item;
329         _tmp2_ = gee_collection_add (self, _tmp1_);
330         result = _tmp0_ | _tmp2_;
331         ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
332         return result;
333 }
334
335
336 static gpointer ___lambda15__gee_fold_func (gpointer g, gpointer a, gpointer self) {
337         gpointer result;
338         result = __lambda15_ (self, g, a);
339         return result;
340 }
341
342
343 static gboolean gee_collection_real_add_all (GeeCollection* self, GeeCollection* collection) {
344         gboolean result = FALSE;
345         GeeCollection* _tmp0_;
346         gpointer _tmp1_ = NULL;
347         g_return_val_if_fail (collection != NULL, FALSE);
348         _tmp0_ = collection;
349         _tmp1_ = gee_traversable_fold ((GeeTraversable*) _tmp0_, G_TYPE_BOOLEAN, NULL, NULL, ___lambda15__gee_fold_func, self, (gpointer) ((gintptr) FALSE));
350         result = (gboolean) ((gintptr) _tmp1_);
351         return result;
352 }
353
354
355 gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection) {
356         g_return_val_if_fail (self != NULL, FALSE);
357         return GEE_COLLECTION_GET_INTERFACE (self)->add_all (self, collection);
358 }
359
360
361 /**
362  * Returns ``true`` it this collection contains all items as the input
363  * collection.
364  *
365  * @param collection the collection which items will be compared with
366  *                   this collection.
367  *
368  * @return     ``true`` if the collection has been changed, ``false`` otherwise
369  */
370 static gboolean __lambda16_ (GeeCollection* self, gpointer item) {
371         gboolean result = FALSE;
372         gconstpointer _tmp0_;
373         gboolean _tmp1_ = FALSE;
374         _tmp0_ = item;
375         _tmp1_ = gee_collection_contains (self, _tmp0_);
376         result = _tmp1_;
377         ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
378         return result;
379 }
380
381
382 static gboolean ___lambda16__gee_forall_func (gpointer g, gpointer self) {
383         gboolean result;
384         result = __lambda16_ (self, g);
385         return result;
386 }
387
388
389 static gboolean gee_collection_real_contains_all (GeeCollection* self, GeeCollection* collection) {
390         gboolean result = FALSE;
391         GeeCollection* _tmp0_;
392         gboolean _tmp1_ = FALSE;
393         g_return_val_if_fail (collection != NULL, FALSE);
394         _tmp0_ = collection;
395         _tmp1_ = gee_traversable_foreach ((GeeTraversable*) _tmp0_, ___lambda16__gee_forall_func, self);
396         result = _tmp1_;
397         return result;
398 }
399
400
401 gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collection) {
402         g_return_val_if_fail (self != NULL, FALSE);
403         return GEE_COLLECTION_GET_INTERFACE (self)->contains_all (self, collection);
404 }
405
406
407 /**
408  * Removes the subset of items in this collection corresponding to the
409  * elments in the input collection. If there is several occurrences of
410  * the same value in this collection they are decremented of the number
411  * of occurrences in the input collection.
412  *
413  * @param collection the collection which items will be compared with
414  *                   this collection.
415  *
416  * @return     ``true`` if the collection has been changed, ``false`` otherwise
417  */
418 static gboolean __lambda17_ (GeeCollection* self, gpointer item, gboolean changed) {
419         gboolean result = FALSE;
420         gboolean _tmp0_;
421         gconstpointer _tmp1_;
422         gboolean _tmp2_ = FALSE;
423         _tmp0_ = changed;
424         _tmp1_ = item;
425         _tmp2_ = gee_collection_remove (self, _tmp1_);
426         result = _tmp0_ | _tmp2_;
427         ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
428         return result;
429 }
430
431
432 static gpointer ___lambda17__gee_fold_func (gpointer g, gpointer a, gpointer self) {
433         gpointer result;
434         result = __lambda17_ (self, g, a);
435         return result;
436 }
437
438
439 static gboolean gee_collection_real_remove_all (GeeCollection* self, GeeCollection* collection) {
440         gboolean result = FALSE;
441         GeeCollection* _tmp0_;
442         gpointer _tmp1_ = NULL;
443         g_return_val_if_fail (collection != NULL, FALSE);
444         _tmp0_ = collection;
445         _tmp1_ = gee_traversable_fold ((GeeTraversable*) _tmp0_, G_TYPE_BOOLEAN, NULL, NULL, ___lambda17__gee_fold_func, self, (gpointer) ((gintptr) FALSE));
446         result = (gboolean) ((gintptr) _tmp1_);
447         return result;
448 }
449
450
451 gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection) {
452         g_return_val_if_fail (self != NULL, FALSE);
453         return GEE_COLLECTION_GET_INTERFACE (self)->remove_all (self, collection);
454 }
455
456
457 /**
458  * Removes all items in this collection that are not contained in the input
459  * collection. In other words all common items of both collections are
460  * retained in this collection.
461  *
462  * @param collection the collection which items will be compared with
463  *                   this collection.
464  *
465  * @return     ``true`` if the collection has been changed, ``false`` otherwise
466  */
467 static gboolean gee_collection_real_retain_all (GeeCollection* self, GeeCollection* collection) {
468         gboolean result = FALSE;
469         gboolean changed;
470         g_return_val_if_fail (collection != NULL, FALSE);
471         changed = FALSE;
472         {
473                 GeeIterator* _tmp0_ = NULL;
474                 GeeIterator* iter;
475                 _tmp0_ = gee_iterable_iterator ((GeeIterable*) self);
476                 iter = _tmp0_;
477                 {
478                         gboolean _tmp1_;
479                         _tmp1_ = TRUE;
480                         while (TRUE) {
481                                 gboolean _tmp2_;
482                                 GeeIterator* _tmp3_;
483                                 gboolean _tmp4_ = FALSE;
484                                 GeeIterator* _tmp5_;
485                                 gpointer _tmp6_ = NULL;
486                                 gpointer item;
487                                 GeeCollection* _tmp7_;
488                                 gconstpointer _tmp8_;
489                                 gboolean _tmp9_ = FALSE;
490                                 _tmp2_ = _tmp1_;
491                                 if (!_tmp2_) {
492                                 }
493                                 _tmp1_ = FALSE;
494                                 _tmp3_ = iter;
495                                 _tmp4_ = gee_iterator_next (_tmp3_);
496                                 if (!_tmp4_) {
497                                         break;
498                                 }
499                                 _tmp5_ = iter;
500                                 _tmp6_ = gee_iterator_get (_tmp5_);
501                                 item = _tmp6_;
502                                 _tmp7_ = collection;
503                                 _tmp8_ = item;
504                                 _tmp9_ = gee_collection_contains (_tmp7_, _tmp8_);
505                                 if (!_tmp9_) {
506                                         GeeIterator* _tmp10_;
507                                         _tmp10_ = iter;
508                                         gee_iterator_remove (_tmp10_);
509                                         changed = TRUE;
510                                 }
511                                 ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
512                         }
513                 }
514                 _g_object_unref0 (iter);
515         }
516         result = changed;
517         return result;
518 }
519
520
521 gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection) {
522         g_return_val_if_fail (self != NULL, FALSE);
523         return GEE_COLLECTION_GET_INTERFACE (self)->retain_all (self, collection);
524 }
525
526
527 /**
528  * Returns an array containing all of items from this collection.
529  *
530  * @return an array containing all of items from this collection
531  */
532 static gpointer* gee_collection_real_to_array (GeeCollection* self, int* result_length1) {
533         gpointer* result = NULL;
534         GType t;
535         GType _tmp0_;
536         t = GEE_COLLECTION_GET_INTERFACE (self)->get_g_type (self);
537         _tmp0_ = t;
538         if (_tmp0_ == G_TYPE_BOOLEAN) {
539                 gint _tmp1_ = 0;
540                 gboolean* _tmp2_ = NULL;
541                 gpointer* _tmp3_;
542                 gint _tmp3__length1;
543                 _tmp2_ = gee_collection_to_bool_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp1_);
544                 _tmp3_ = (gpointer*) _tmp2_;
545                 _tmp3__length1 = (_tmp1_ * sizeof (gboolean)) / sizeof (gpointer);
546                 if (result_length1) {
547                         *result_length1 = _tmp3__length1;
548                 }
549                 result = _tmp3_;
550                 return result;
551         } else {
552                 GType _tmp4_;
553                 _tmp4_ = t;
554                 if (_tmp4_ == G_TYPE_CHAR) {
555                         gint _tmp5_ = 0;
556                         gchar* _tmp6_ = NULL;
557                         gpointer* _tmp7_;
558                         gint _tmp7__length1;
559                         _tmp6_ = gee_collection_to_char_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp5_);
560                         _tmp7_ = (gpointer*) _tmp6_;
561                         _tmp7__length1 = (_tmp5_ * sizeof (gchar)) / sizeof (gpointer);
562                         if (result_length1) {
563                                 *result_length1 = _tmp7__length1;
564                         }
565                         result = _tmp7_;
566                         return result;
567                 } else {
568                         GType _tmp8_;
569                         _tmp8_ = t;
570                         if (_tmp8_ == G_TYPE_UCHAR) {
571                                 gint _tmp9_ = 0;
572                                 guchar* _tmp10_ = NULL;
573                                 gpointer* _tmp11_;
574                                 gint _tmp11__length1;
575                                 _tmp10_ = gee_collection_to_uchar_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp9_);
576                                 _tmp11_ = (gpointer*) _tmp10_;
577                                 _tmp11__length1 = (_tmp9_ * sizeof (guchar)) / sizeof (gpointer);
578                                 if (result_length1) {
579                                         *result_length1 = _tmp11__length1;
580                                 }
581                                 result = _tmp11_;
582                                 return result;
583                         } else {
584                                 GType _tmp12_;
585                                 _tmp12_ = t;
586                                 if (_tmp12_ == G_TYPE_INT) {
587                                         gint _tmp13_ = 0;
588                                         gint* _tmp14_ = NULL;
589                                         gpointer* _tmp15_;
590                                         gint _tmp15__length1;
591                                         _tmp14_ = gee_collection_to_int_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp13_);
592                                         _tmp15_ = (gpointer*) _tmp14_;
593                                         _tmp15__length1 = (_tmp13_ * sizeof (gint)) / sizeof (gpointer);
594                                         if (result_length1) {
595                                                 *result_length1 = _tmp15__length1;
596                                         }
597                                         result = _tmp15_;
598                                         return result;
599                                 } else {
600                                         GType _tmp16_;
601                                         _tmp16_ = t;
602                                         if (_tmp16_ == G_TYPE_UINT) {
603                                                 gint _tmp17_ = 0;
604                                                 guint* _tmp18_ = NULL;
605                                                 gpointer* _tmp19_;
606                                                 gint _tmp19__length1;
607                                                 _tmp18_ = gee_collection_to_uint_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp17_);
608                                                 _tmp19_ = (gpointer*) _tmp18_;
609                                                 _tmp19__length1 = (_tmp17_ * sizeof (guint)) / sizeof (gpointer);
610                                                 if (result_length1) {
611                                                         *result_length1 = _tmp19__length1;
612                                                 }
613                                                 result = _tmp19_;
614                                                 return result;
615                                         } else {
616                                                 GType _tmp20_;
617                                                 _tmp20_ = t;
618                                                 if (_tmp20_ == G_TYPE_INT64) {
619                                                         gint _tmp21_ = 0;
620                                                         gint64* _tmp22_ = NULL;
621                                                         gpointer* _tmp23_;
622                                                         gint _tmp23__length1;
623                                                         _tmp22_ = gee_collection_to_int64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp21_);
624                                                         _tmp23_ = (gpointer*) _tmp22_;
625                                                         _tmp23__length1 = (_tmp21_ * sizeof (gint64)) / sizeof (gpointer);
626                                                         if (result_length1) {
627                                                                 *result_length1 = _tmp23__length1;
628                                                         }
629                                                         result = _tmp23_;
630                                                         return result;
631                                                 } else {
632                                                         GType _tmp24_;
633                                                         _tmp24_ = t;
634                                                         if (_tmp24_ == G_TYPE_UINT64) {
635                                                                 gint _tmp25_ = 0;
636                                                                 guint64* _tmp26_ = NULL;
637                                                                 gpointer* _tmp27_;
638                                                                 gint _tmp27__length1;
639                                                                 _tmp26_ = gee_collection_to_uint64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp25_);
640                                                                 _tmp27_ = (gpointer*) _tmp26_;
641                                                                 _tmp27__length1 = (_tmp25_ * sizeof (guint64)) / sizeof (gpointer);
642                                                                 if (result_length1) {
643                                                                         *result_length1 = _tmp27__length1;
644                                                                 }
645                                                                 result = _tmp27_;
646                                                                 return result;
647                                                         } else {
648                                                                 GType _tmp28_;
649                                                                 _tmp28_ = t;
650                                                                 if (_tmp28_ == G_TYPE_LONG) {
651                                                                         gint _tmp29_ = 0;
652                                                                         glong* _tmp30_ = NULL;
653                                                                         gpointer* _tmp31_;
654                                                                         gint _tmp31__length1;
655                                                                         _tmp30_ = gee_collection_to_long_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp29_);
656                                                                         _tmp31_ = (gpointer*) _tmp30_;
657                                                                         _tmp31__length1 = (_tmp29_ * sizeof (glong)) / sizeof (gpointer);
658                                                                         if (result_length1) {
659                                                                                 *result_length1 = _tmp31__length1;
660                                                                         }
661                                                                         result = _tmp31_;
662                                                                         return result;
663                                                                 } else {
664                                                                         GType _tmp32_;
665                                                                         _tmp32_ = t;
666                                                                         if (_tmp32_ == G_TYPE_ULONG) {
667                                                                                 gint _tmp33_ = 0;
668                                                                                 gulong* _tmp34_ = NULL;
669                                                                                 gpointer* _tmp35_;
670                                                                                 gint _tmp35__length1;
671                                                                                 _tmp34_ = gee_collection_to_ulong_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp33_);
672                                                                                 _tmp35_ = (gpointer*) _tmp34_;
673                                                                                 _tmp35__length1 = (_tmp33_ * sizeof (gulong)) / sizeof (gpointer);
674                                                                                 if (result_length1) {
675                                                                                         *result_length1 = _tmp35__length1;
676                                                                                 }
677                                                                                 result = _tmp35_;
678                                                                                 return result;
679                                                                         } else {
680                                                                                 GType _tmp36_;
681                                                                                 _tmp36_ = t;
682                                                                                 if (_tmp36_ == G_TYPE_FLOAT) {
683                                                                                         gint _tmp37_ = 0;
684                                                                                         gfloat** _tmp38_ = NULL;
685                                                                                         gpointer* _tmp39_;
686                                                                                         gint _tmp39__length1;
687                                                                                         _tmp38_ = gee_collection_to_float_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp37_);
688                                                                                         _tmp39_ = (gpointer*) _tmp38_;
689                                                                                         _tmp39__length1 = (_tmp37_ * sizeof (gfloat*)) / sizeof (gpointer);
690                                                                                         if (result_length1) {
691                                                                                                 *result_length1 = _tmp39__length1;
692                                                                                         }
693                                                                                         result = _tmp39_;
694                                                                                         return result;
695                                                                                 } else {
696                                                                                         GType _tmp40_;
697                                                                                         _tmp40_ = t;
698                                                                                         if (_tmp40_ == G_TYPE_DOUBLE) {
699                                                                                                 gint _tmp41_ = 0;
700                                                                                                 gdouble** _tmp42_ = NULL;
701                                                                                                 gpointer* _tmp43_;
702                                                                                                 gint _tmp43__length1;
703                                                                                                 _tmp42_ = gee_collection_to_double_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp41_);
704                                                                                                 _tmp43_ = (gpointer*) _tmp42_;
705                                                                                                 _tmp43__length1 = (_tmp41_ * sizeof (gdouble*)) / sizeof (gpointer);
706                                                                                                 if (result_length1) {
707                                                                                                         *result_length1 = _tmp43__length1;
708                                                                                                 }
709                                                                                                 result = _tmp43_;
710                                                                                                 return result;
711                                                                                         } else {
712                                                                                                 gint _tmp44_;
713                                                                                                 gint _tmp45_;
714                                                                                                 gpointer* _tmp46_ = NULL;
715                                                                                                 gpointer* array;
716                                                                                                 gint array_length1;
717                                                                                                 gint _array_size_;
718                                                                                                 gint index;
719                                                                                                 gpointer* _tmp57_;
720                                                                                                 gint _tmp57__length1;
721                                                                                                 _tmp44_ = gee_collection_get_size (self);
722                                                                                                 _tmp45_ = _tmp44_;
723                                                                                                 _tmp46_ = g_new0 (gpointer, _tmp45_);
724                                                                                                 array = _tmp46_;
725                                                                                                 array_length1 = _tmp45_;
726                                                                                                 _array_size_ = array_length1;
727                                                                                                 index = 0;
728                                                                                                 {
729                                                                                                         GeeIterator* _tmp47_ = NULL;
730                                                                                                         GeeIterator* _element_it;
731                                                                                                         _tmp47_ = gee_iterable_iterator ((GeeIterable*) self);
732                                                                                                         _element_it = _tmp47_;
733                                                                                                         while (TRUE) {
734                                                                                                                 GeeIterator* _tmp48_;
735                                                                                                                 gboolean _tmp49_ = FALSE;
736                                                                                                                 GeeIterator* _tmp50_;
737                                                                                                                 gpointer _tmp51_ = NULL;
738                                                                                                                 gpointer element;
739                                                                                                                 gpointer* _tmp52_;
740                                                                                                                 gint _tmp52__length1;
741                                                                                                                 gint _tmp53_;
742                                                                                                                 gconstpointer _tmp54_;
743                                                                                                                 gpointer _tmp55_;
744                                                                                                                 gpointer _tmp56_;
745                                                                                                                 _tmp48_ = _element_it;
746                                                                                                                 _tmp49_ = gee_iterator_next (_tmp48_);
747                                                                                                                 if (!_tmp49_) {
748                                                                                                                         break;
749                                                                                                                 }
750                                                                                                                 _tmp50_ = _element_it;
751                                                                                                                 _tmp51_ = gee_iterator_get (_tmp50_);
752                                                                                                                 element = _tmp51_;
753                                                                                                                 _tmp52_ = array;
754                                                                                                                 _tmp52__length1 = array_length1;
755                                                                                                                 _tmp53_ = index;
756                                                                                                                 index = _tmp53_ + 1;
757                                                                                                                 _tmp54_ = element;
758                                                                                                                 _tmp55_ = ((_tmp54_ != NULL) && (GEE_COLLECTION_GET_INTERFACE (self)->get_g_dup_func (self) != NULL)) ? GEE_COLLECTION_GET_INTERFACE (self)->get_g_dup_func (self) ((gpointer) _tmp54_) : ((gpointer) _tmp54_);
759                                                                                                                 ((_tmp52_[_tmp53_] == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (_tmp52_[_tmp53_] = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (_tmp52_[_tmp53_]), NULL));
760                                                                                                                 _tmp52_[_tmp53_] = _tmp55_;
761                                                                                                                 _tmp56_ = _tmp52_[_tmp53_];
762                                                                                                                 ((element == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (element = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (element), NULL));
763                                                                                                         }
764                                                                                                         _g_object_unref0 (_element_it);
765                                                                                                 }
766                                                                                                 _tmp57_ = array;
767                                                                                                 _tmp57__length1 = array_length1;
768                                                                                                 if (result_length1) {
769                                                                                                         *result_length1 = _tmp57__length1;
770                                                                                                 }
771                                                                                                 result = _tmp57_;
772                                                                                                 return result;
773                                                                                         }
774                                                                                 }
775                                                                         }
776                                                                 }
777                                                         }
778                                                 }
779                                         }
780                                 }
781                         }
782                 }
783         }
784 }
785
786
787 gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1) {
788         g_return_val_if_fail (self != NULL, NULL);
789         return GEE_COLLECTION_GET_INTERFACE (self)->to_array (self, result_length1);
790 }
791
792
793 /**
794  * Adds all items in the input array to this collection.
795  *
796  * @param array the array which items will be added to this
797  *              collection.
798  *
799  * @return     ``true`` if the collection has been changed, ``false`` otherwise
800  */
801 gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1) {
802         gboolean result = FALSE;
803         gboolean changed;
804         gpointer* _tmp0_;
805         gint _tmp0__length1;
806         changed = FALSE;
807         _tmp0_ = array;
808         _tmp0__length1 = array_length1;
809         {
810                 gpointer* item_collection = NULL;
811                 gint item_collection_length1 = 0;
812                 gint _item_collection_size_ = 0;
813                 gint item_it = 0;
814                 item_collection = _tmp0_;
815                 item_collection_length1 = _tmp0__length1;
816                 for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) {
817                         gconstpointer item = NULL;
818                         item = item_collection[item_it];
819                         {
820                                 gboolean _tmp1_;
821                                 gconstpointer _tmp2_;
822                                 gboolean _tmp3_ = FALSE;
823                                 _tmp1_ = changed;
824                                 _tmp2_ = item;
825                                 _tmp3_ = gee_collection_add (self, _tmp2_);
826                                 changed = _tmp1_ | _tmp3_;
827                         }
828                 }
829         }
830         result = changed;
831         return result;
832 }
833
834
835 /**
836  * Returns ``true`` it this collection contains all items as the input
837  * array.
838  *
839  * @param array the array which items will be compared with
840  *              this collection.
841  *
842  * @return     ``true`` if the collection has been changed, ``false`` otherwise
843  */
844 gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1) {
845         gboolean result = FALSE;
846         gpointer* _tmp0_;
847         gint _tmp0__length1;
848         _tmp0_ = array;
849         _tmp0__length1 = array_length1;
850         {
851                 gpointer* item_collection = NULL;
852                 gint item_collection_length1 = 0;
853                 gint _item_collection_size_ = 0;
854                 gint item_it = 0;
855                 item_collection = _tmp0_;
856                 item_collection_length1 = _tmp0__length1;
857                 for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) {
858                         gconstpointer item = NULL;
859                         item = item_collection[item_it];
860                         {
861                                 gconstpointer _tmp1_;
862                                 gboolean _tmp2_ = FALSE;
863                                 _tmp1_ = item;
864                                 _tmp2_ = gee_collection_contains (self, _tmp1_);
865                                 if (!_tmp2_) {
866                                         result = FALSE;
867                                         return result;
868                                 }
869                         }
870                 }
871         }
872         result = TRUE;
873         return result;
874 }
875
876
877 /**
878  * Removes the subset of items in this collection corresponding to the
879  * elments in the input array. If there is several occurrences of
880  * the same value in this collection they are decremented of the number
881  * of occurrences in the input array.
882  *
883  * @param array the array which items will be compared with
884  *              this collection.
885  *
886  * @return     ``true`` if the collection has been changed, ``false`` otherwise
887  */
888 gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1) {
889         gboolean result = FALSE;
890         gboolean changed;
891         gpointer* _tmp0_;
892         gint _tmp0__length1;
893         changed = FALSE;
894         _tmp0_ = array;
895         _tmp0__length1 = array_length1;
896         {
897                 gpointer* item_collection = NULL;
898                 gint item_collection_length1 = 0;
899                 gint _item_collection_size_ = 0;
900                 gint item_it = 0;
901                 item_collection = _tmp0_;
902                 item_collection_length1 = _tmp0__length1;
903                 for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) {
904                         gconstpointer item = NULL;
905                         item = item_collection[item_it];
906                         {
907                                 gboolean _tmp1_;
908                                 gconstpointer _tmp2_;
909                                 gboolean _tmp3_ = FALSE;
910                                 _tmp1_ = changed;
911                                 _tmp2_ = item;
912                                 _tmp3_ = gee_collection_remove (self, _tmp2_);
913                                 changed = _tmp1_ | _tmp3_;
914                         }
915                 }
916         }
917         result = changed;
918         return result;
919 }
920
921
922 static gboolean* gee_collection_to_bool_array (GeeCollection* coll, int* result_length1) {
923         gboolean* result = NULL;
924         GeeCollection* _tmp0_;
925         gint _tmp1_;
926         gint _tmp2_;
927         gboolean* _tmp3_ = NULL;
928         gboolean* array;
929         gint array_length1;
930         gint _array_size_;
931         gint index;
932         gboolean* _tmp14_;
933         gint _tmp14__length1;
934         g_return_val_if_fail (coll != NULL, NULL);
935         _tmp0_ = coll;
936         _tmp1_ = gee_collection_get_size (_tmp0_);
937         _tmp2_ = _tmp1_;
938         _tmp3_ = g_new0 (gboolean, _tmp2_);
939         array = _tmp3_;
940         array_length1 = _tmp2_;
941         _array_size_ = array_length1;
942         index = 0;
943         {
944                 GeeCollection* _tmp4_;
945                 GeeIterator* _tmp5_ = NULL;
946                 GeeIterator* _element_it;
947                 _tmp4_ = coll;
948                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
949                 _element_it = _tmp5_;
950                 while (TRUE) {
951                         GeeIterator* _tmp6_;
952                         gboolean _tmp7_ = FALSE;
953                         GeeIterator* _tmp8_;
954                         gpointer _tmp9_ = NULL;
955                         gboolean element;
956                         gboolean* _tmp10_;
957                         gint _tmp10__length1;
958                         gint _tmp11_;
959                         gboolean _tmp12_;
960                         gboolean _tmp13_;
961                         _tmp6_ = _element_it;
962                         _tmp7_ = gee_iterator_next (_tmp6_);
963                         if (!_tmp7_) {
964                                 break;
965                         }
966                         _tmp8_ = _element_it;
967                         _tmp9_ = gee_iterator_get (_tmp8_);
968                         element = (gboolean) ((gintptr) _tmp9_);
969                         _tmp10_ = array;
970                         _tmp10__length1 = array_length1;
971                         _tmp11_ = index;
972                         index = _tmp11_ + 1;
973                         _tmp12_ = element;
974                         _tmp10_[_tmp11_] = _tmp12_;
975                         _tmp13_ = _tmp10_[_tmp11_];
976                 }
977                 _g_object_unref0 (_element_it);
978         }
979         _tmp14_ = array;
980         _tmp14__length1 = array_length1;
981         if (result_length1) {
982                 *result_length1 = _tmp14__length1;
983         }
984         result = _tmp14_;
985         return result;
986 }
987
988
989 static gchar* gee_collection_to_char_array (GeeCollection* coll, int* result_length1) {
990         gchar* result = NULL;
991         GeeCollection* _tmp0_;
992         gint _tmp1_;
993         gint _tmp2_;
994         gchar* _tmp3_ = NULL;
995         gchar* array;
996         gint array_length1;
997         gint _array_size_;
998         gint index;
999         gchar* _tmp14_;
1000         gint _tmp14__length1;
1001         g_return_val_if_fail (coll != NULL, NULL);
1002         _tmp0_ = coll;
1003         _tmp1_ = gee_collection_get_size (_tmp0_);
1004         _tmp2_ = _tmp1_;
1005         _tmp3_ = g_new0 (gchar, _tmp2_);
1006         array = _tmp3_;
1007         array_length1 = _tmp2_;
1008         _array_size_ = array_length1;
1009         index = 0;
1010         {
1011                 GeeCollection* _tmp4_;
1012                 GeeIterator* _tmp5_ = NULL;
1013                 GeeIterator* _element_it;
1014                 _tmp4_ = coll;
1015                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1016                 _element_it = _tmp5_;
1017                 while (TRUE) {
1018                         GeeIterator* _tmp6_;
1019                         gboolean _tmp7_ = FALSE;
1020                         GeeIterator* _tmp8_;
1021                         gpointer _tmp9_ = NULL;
1022                         gchar element;
1023                         gchar* _tmp10_;
1024                         gint _tmp10__length1;
1025                         gint _tmp11_;
1026                         gchar _tmp12_;
1027                         gchar _tmp13_;
1028                         _tmp6_ = _element_it;
1029                         _tmp7_ = gee_iterator_next (_tmp6_);
1030                         if (!_tmp7_) {
1031                                 break;
1032                         }
1033                         _tmp8_ = _element_it;
1034                         _tmp9_ = gee_iterator_get (_tmp8_);
1035                         element = (gchar) ((gintptr) _tmp9_);
1036                         _tmp10_ = array;
1037                         _tmp10__length1 = array_length1;
1038                         _tmp11_ = index;
1039                         index = _tmp11_ + 1;
1040                         _tmp12_ = element;
1041                         _tmp10_[_tmp11_] = _tmp12_;
1042                         _tmp13_ = _tmp10_[_tmp11_];
1043                 }
1044                 _g_object_unref0 (_element_it);
1045         }
1046         _tmp14_ = array;
1047         _tmp14__length1 = array_length1;
1048         if (result_length1) {
1049                 *result_length1 = _tmp14__length1;
1050         }
1051         result = _tmp14_;
1052         return result;
1053 }
1054
1055
1056 static guchar* gee_collection_to_uchar_array (GeeCollection* coll, int* result_length1) {
1057         guchar* result = NULL;
1058         GeeCollection* _tmp0_;
1059         gint _tmp1_;
1060         gint _tmp2_;
1061         guchar* _tmp3_ = NULL;
1062         guchar* array;
1063         gint array_length1;
1064         gint _array_size_;
1065         gint index;
1066         guchar* _tmp14_;
1067         gint _tmp14__length1;
1068         g_return_val_if_fail (coll != NULL, NULL);
1069         _tmp0_ = coll;
1070         _tmp1_ = gee_collection_get_size (_tmp0_);
1071         _tmp2_ = _tmp1_;
1072         _tmp3_ = g_new0 (guchar, _tmp2_);
1073         array = _tmp3_;
1074         array_length1 = _tmp2_;
1075         _array_size_ = array_length1;
1076         index = 0;
1077         {
1078                 GeeCollection* _tmp4_;
1079                 GeeIterator* _tmp5_ = NULL;
1080                 GeeIterator* _element_it;
1081                 _tmp4_ = coll;
1082                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1083                 _element_it = _tmp5_;
1084                 while (TRUE) {
1085                         GeeIterator* _tmp6_;
1086                         gboolean _tmp7_ = FALSE;
1087                         GeeIterator* _tmp8_;
1088                         gpointer _tmp9_ = NULL;
1089                         guchar element;
1090                         guchar* _tmp10_;
1091                         gint _tmp10__length1;
1092                         gint _tmp11_;
1093                         guchar _tmp12_;
1094                         guchar _tmp13_;
1095                         _tmp6_ = _element_it;
1096                         _tmp7_ = gee_iterator_next (_tmp6_);
1097                         if (!_tmp7_) {
1098                                 break;
1099                         }
1100                         _tmp8_ = _element_it;
1101                         _tmp9_ = gee_iterator_get (_tmp8_);
1102                         element = (guchar) ((guintptr) _tmp9_);
1103                         _tmp10_ = array;
1104                         _tmp10__length1 = array_length1;
1105                         _tmp11_ = index;
1106                         index = _tmp11_ + 1;
1107                         _tmp12_ = element;
1108                         _tmp10_[_tmp11_] = _tmp12_;
1109                         _tmp13_ = _tmp10_[_tmp11_];
1110                 }
1111                 _g_object_unref0 (_element_it);
1112         }
1113         _tmp14_ = array;
1114         _tmp14__length1 = array_length1;
1115         if (result_length1) {
1116                 *result_length1 = _tmp14__length1;
1117         }
1118         result = _tmp14_;
1119         return result;
1120 }
1121
1122
1123 static gint* gee_collection_to_int_array (GeeCollection* coll, int* result_length1) {
1124         gint* result = NULL;
1125         GeeCollection* _tmp0_;
1126         gint _tmp1_;
1127         gint _tmp2_;
1128         gint* _tmp3_ = NULL;
1129         gint* array;
1130         gint array_length1;
1131         gint _array_size_;
1132         gint index;
1133         gint* _tmp14_;
1134         gint _tmp14__length1;
1135         g_return_val_if_fail (coll != NULL, NULL);
1136         _tmp0_ = coll;
1137         _tmp1_ = gee_collection_get_size (_tmp0_);
1138         _tmp2_ = _tmp1_;
1139         _tmp3_ = g_new0 (gint, _tmp2_);
1140         array = _tmp3_;
1141         array_length1 = _tmp2_;
1142         _array_size_ = array_length1;
1143         index = 0;
1144         {
1145                 GeeCollection* _tmp4_;
1146                 GeeIterator* _tmp5_ = NULL;
1147                 GeeIterator* _element_it;
1148                 _tmp4_ = coll;
1149                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1150                 _element_it = _tmp5_;
1151                 while (TRUE) {
1152                         GeeIterator* _tmp6_;
1153                         gboolean _tmp7_ = FALSE;
1154                         GeeIterator* _tmp8_;
1155                         gpointer _tmp9_ = NULL;
1156                         gint element;
1157                         gint* _tmp10_;
1158                         gint _tmp10__length1;
1159                         gint _tmp11_;
1160                         gint _tmp12_;
1161                         gint _tmp13_;
1162                         _tmp6_ = _element_it;
1163                         _tmp7_ = gee_iterator_next (_tmp6_);
1164                         if (!_tmp7_) {
1165                                 break;
1166                         }
1167                         _tmp8_ = _element_it;
1168                         _tmp9_ = gee_iterator_get (_tmp8_);
1169                         element = (gint) ((gintptr) _tmp9_);
1170                         _tmp10_ = array;
1171                         _tmp10__length1 = array_length1;
1172                         _tmp11_ = index;
1173                         index = _tmp11_ + 1;
1174                         _tmp12_ = element;
1175                         _tmp10_[_tmp11_] = _tmp12_;
1176                         _tmp13_ = _tmp10_[_tmp11_];
1177                 }
1178                 _g_object_unref0 (_element_it);
1179         }
1180         _tmp14_ = array;
1181         _tmp14__length1 = array_length1;
1182         if (result_length1) {
1183                 *result_length1 = _tmp14__length1;
1184         }
1185         result = _tmp14_;
1186         return result;
1187 }
1188
1189
1190 static guint* gee_collection_to_uint_array (GeeCollection* coll, int* result_length1) {
1191         guint* result = NULL;
1192         GeeCollection* _tmp0_;
1193         gint _tmp1_;
1194         gint _tmp2_;
1195         guint* _tmp3_ = NULL;
1196         guint* array;
1197         gint array_length1;
1198         gint _array_size_;
1199         gint index;
1200         guint* _tmp14_;
1201         gint _tmp14__length1;
1202         g_return_val_if_fail (coll != NULL, NULL);
1203         _tmp0_ = coll;
1204         _tmp1_ = gee_collection_get_size (_tmp0_);
1205         _tmp2_ = _tmp1_;
1206         _tmp3_ = g_new0 (guint, _tmp2_);
1207         array = _tmp3_;
1208         array_length1 = _tmp2_;
1209         _array_size_ = array_length1;
1210         index = 0;
1211         {
1212                 GeeCollection* _tmp4_;
1213                 GeeIterator* _tmp5_ = NULL;
1214                 GeeIterator* _element_it;
1215                 _tmp4_ = coll;
1216                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1217                 _element_it = _tmp5_;
1218                 while (TRUE) {
1219                         GeeIterator* _tmp6_;
1220                         gboolean _tmp7_ = FALSE;
1221                         GeeIterator* _tmp8_;
1222                         gpointer _tmp9_ = NULL;
1223                         guint element;
1224                         guint* _tmp10_;
1225                         gint _tmp10__length1;
1226                         gint _tmp11_;
1227                         guint _tmp12_;
1228                         guint _tmp13_;
1229                         _tmp6_ = _element_it;
1230                         _tmp7_ = gee_iterator_next (_tmp6_);
1231                         if (!_tmp7_) {
1232                                 break;
1233                         }
1234                         _tmp8_ = _element_it;
1235                         _tmp9_ = gee_iterator_get (_tmp8_);
1236                         element = (guint) ((guintptr) _tmp9_);
1237                         _tmp10_ = array;
1238                         _tmp10__length1 = array_length1;
1239                         _tmp11_ = index;
1240                         index = _tmp11_ + 1;
1241                         _tmp12_ = element;
1242                         _tmp10_[_tmp11_] = _tmp12_;
1243                         _tmp13_ = _tmp10_[_tmp11_];
1244                 }
1245                 _g_object_unref0 (_element_it);
1246         }
1247         _tmp14_ = array;
1248         _tmp14__length1 = array_length1;
1249         if (result_length1) {
1250                 *result_length1 = _tmp14__length1;
1251         }
1252         result = _tmp14_;
1253         return result;
1254 }
1255
1256
1257 static gint64* gee_collection_to_int64_array (GeeCollection* coll, int* result_length1) {
1258         gint64* result = NULL;
1259         GeeCollection* _tmp0_;
1260         gint _tmp1_;
1261         gint _tmp2_;
1262         gint64* _tmp3_ = NULL;
1263         gint64* array;
1264         gint array_length1;
1265         gint _array_size_;
1266         gint index;
1267         gint64* _tmp16_;
1268         gint _tmp16__length1;
1269         g_return_val_if_fail (coll != NULL, NULL);
1270         _tmp0_ = coll;
1271         _tmp1_ = gee_collection_get_size (_tmp0_);
1272         _tmp2_ = _tmp1_;
1273         _tmp3_ = g_new0 (gint64, _tmp2_);
1274         array = _tmp3_;
1275         array_length1 = _tmp2_;
1276         _array_size_ = array_length1;
1277         index = 0;
1278         {
1279                 GeeCollection* _tmp4_;
1280                 GeeIterator* _tmp5_ = NULL;
1281                 GeeIterator* _element_it;
1282                 _tmp4_ = coll;
1283                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1284                 _element_it = _tmp5_;
1285                 while (TRUE) {
1286                         GeeIterator* _tmp6_;
1287                         gboolean _tmp7_ = FALSE;
1288                         GeeIterator* _tmp8_;
1289                         gpointer _tmp9_ = NULL;
1290                         gint64* _tmp10_;
1291                         gint64 _tmp11_;
1292                         gint64 element;
1293                         gint64* _tmp12_;
1294                         gint _tmp12__length1;
1295                         gint _tmp13_;
1296                         gint64 _tmp14_;
1297                         gint64 _tmp15_;
1298                         _tmp6_ = _element_it;
1299                         _tmp7_ = gee_iterator_next (_tmp6_);
1300                         if (!_tmp7_) {
1301                                 break;
1302                         }
1303                         _tmp8_ = _element_it;
1304                         _tmp9_ = gee_iterator_get (_tmp8_);
1305                         _tmp10_ = (gint64*) _tmp9_;
1306                         _tmp11_ = *_tmp10_;
1307                         _g_free0 (_tmp10_);
1308                         element = _tmp11_;
1309                         _tmp12_ = array;
1310                         _tmp12__length1 = array_length1;
1311                         _tmp13_ = index;
1312                         index = _tmp13_ + 1;
1313                         _tmp14_ = element;
1314                         _tmp12_[_tmp13_] = _tmp14_;
1315                         _tmp15_ = _tmp12_[_tmp13_];
1316                 }
1317                 _g_object_unref0 (_element_it);
1318         }
1319         _tmp16_ = array;
1320         _tmp16__length1 = array_length1;
1321         if (result_length1) {
1322                 *result_length1 = _tmp16__length1;
1323         }
1324         result = _tmp16_;
1325         return result;
1326 }
1327
1328
1329 static guint64* gee_collection_to_uint64_array (GeeCollection* coll, int* result_length1) {
1330         guint64* result = NULL;
1331         GeeCollection* _tmp0_;
1332         gint _tmp1_;
1333         gint _tmp2_;
1334         guint64* _tmp3_ = NULL;
1335         guint64* array;
1336         gint array_length1;
1337         gint _array_size_;
1338         gint index;
1339         guint64* _tmp16_;
1340         gint _tmp16__length1;
1341         g_return_val_if_fail (coll != NULL, NULL);
1342         _tmp0_ = coll;
1343         _tmp1_ = gee_collection_get_size (_tmp0_);
1344         _tmp2_ = _tmp1_;
1345         _tmp3_ = g_new0 (guint64, _tmp2_);
1346         array = _tmp3_;
1347         array_length1 = _tmp2_;
1348         _array_size_ = array_length1;
1349         index = 0;
1350         {
1351                 GeeCollection* _tmp4_;
1352                 GeeIterator* _tmp5_ = NULL;
1353                 GeeIterator* _element_it;
1354                 _tmp4_ = coll;
1355                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1356                 _element_it = _tmp5_;
1357                 while (TRUE) {
1358                         GeeIterator* _tmp6_;
1359                         gboolean _tmp7_ = FALSE;
1360                         GeeIterator* _tmp8_;
1361                         gpointer _tmp9_ = NULL;
1362                         guint64* _tmp10_;
1363                         guint64 _tmp11_;
1364                         guint64 element;
1365                         guint64* _tmp12_;
1366                         gint _tmp12__length1;
1367                         gint _tmp13_;
1368                         guint64 _tmp14_;
1369                         guint64 _tmp15_;
1370                         _tmp6_ = _element_it;
1371                         _tmp7_ = gee_iterator_next (_tmp6_);
1372                         if (!_tmp7_) {
1373                                 break;
1374                         }
1375                         _tmp8_ = _element_it;
1376                         _tmp9_ = gee_iterator_get (_tmp8_);
1377                         _tmp10_ = (guint64*) _tmp9_;
1378                         _tmp11_ = *_tmp10_;
1379                         _g_free0 (_tmp10_);
1380                         element = _tmp11_;
1381                         _tmp12_ = array;
1382                         _tmp12__length1 = array_length1;
1383                         _tmp13_ = index;
1384                         index = _tmp13_ + 1;
1385                         _tmp14_ = element;
1386                         _tmp12_[_tmp13_] = _tmp14_;
1387                         _tmp15_ = _tmp12_[_tmp13_];
1388                 }
1389                 _g_object_unref0 (_element_it);
1390         }
1391         _tmp16_ = array;
1392         _tmp16__length1 = array_length1;
1393         if (result_length1) {
1394                 *result_length1 = _tmp16__length1;
1395         }
1396         result = _tmp16_;
1397         return result;
1398 }
1399
1400
1401 static glong* gee_collection_to_long_array (GeeCollection* coll, int* result_length1) {
1402         glong* result = NULL;
1403         GeeCollection* _tmp0_;
1404         gint _tmp1_;
1405         gint _tmp2_;
1406         glong* _tmp3_ = NULL;
1407         glong* array;
1408         gint array_length1;
1409         gint _array_size_;
1410         gint index;
1411         glong* _tmp14_;
1412         gint _tmp14__length1;
1413         g_return_val_if_fail (coll != NULL, NULL);
1414         _tmp0_ = coll;
1415         _tmp1_ = gee_collection_get_size (_tmp0_);
1416         _tmp2_ = _tmp1_;
1417         _tmp3_ = g_new0 (glong, _tmp2_);
1418         array = _tmp3_;
1419         array_length1 = _tmp2_;
1420         _array_size_ = array_length1;
1421         index = 0;
1422         {
1423                 GeeCollection* _tmp4_;
1424                 GeeIterator* _tmp5_ = NULL;
1425                 GeeIterator* _element_it;
1426                 _tmp4_ = coll;
1427                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1428                 _element_it = _tmp5_;
1429                 while (TRUE) {
1430                         GeeIterator* _tmp6_;
1431                         gboolean _tmp7_ = FALSE;
1432                         GeeIterator* _tmp8_;
1433                         gpointer _tmp9_ = NULL;
1434                         glong element;
1435                         glong* _tmp10_;
1436                         gint _tmp10__length1;
1437                         gint _tmp11_;
1438                         glong _tmp12_;
1439                         glong _tmp13_;
1440                         _tmp6_ = _element_it;
1441                         _tmp7_ = gee_iterator_next (_tmp6_);
1442                         if (!_tmp7_) {
1443                                 break;
1444                         }
1445                         _tmp8_ = _element_it;
1446                         _tmp9_ = gee_iterator_get (_tmp8_);
1447                         element = (glong) ((gintptr) _tmp9_);
1448                         _tmp10_ = array;
1449                         _tmp10__length1 = array_length1;
1450                         _tmp11_ = index;
1451                         index = _tmp11_ + 1;
1452                         _tmp12_ = element;
1453                         _tmp10_[_tmp11_] = _tmp12_;
1454                         _tmp13_ = _tmp10_[_tmp11_];
1455                 }
1456                 _g_object_unref0 (_element_it);
1457         }
1458         _tmp14_ = array;
1459         _tmp14__length1 = array_length1;
1460         if (result_length1) {
1461                 *result_length1 = _tmp14__length1;
1462         }
1463         result = _tmp14_;
1464         return result;
1465 }
1466
1467
1468 static gulong* gee_collection_to_ulong_array (GeeCollection* coll, int* result_length1) {
1469         gulong* result = NULL;
1470         GeeCollection* _tmp0_;
1471         gint _tmp1_;
1472         gint _tmp2_;
1473         gulong* _tmp3_ = NULL;
1474         gulong* array;
1475         gint array_length1;
1476         gint _array_size_;
1477         gint index;
1478         gulong* _tmp14_;
1479         gint _tmp14__length1;
1480         g_return_val_if_fail (coll != NULL, NULL);
1481         _tmp0_ = coll;
1482         _tmp1_ = gee_collection_get_size (_tmp0_);
1483         _tmp2_ = _tmp1_;
1484         _tmp3_ = g_new0 (gulong, _tmp2_);
1485         array = _tmp3_;
1486         array_length1 = _tmp2_;
1487         _array_size_ = array_length1;
1488         index = 0;
1489         {
1490                 GeeCollection* _tmp4_;
1491                 GeeIterator* _tmp5_ = NULL;
1492                 GeeIterator* _element_it;
1493                 _tmp4_ = coll;
1494                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1495                 _element_it = _tmp5_;
1496                 while (TRUE) {
1497                         GeeIterator* _tmp6_;
1498                         gboolean _tmp7_ = FALSE;
1499                         GeeIterator* _tmp8_;
1500                         gpointer _tmp9_ = NULL;
1501                         gulong element;
1502                         gulong* _tmp10_;
1503                         gint _tmp10__length1;
1504                         gint _tmp11_;
1505                         gulong _tmp12_;
1506                         gulong _tmp13_;
1507                         _tmp6_ = _element_it;
1508                         _tmp7_ = gee_iterator_next (_tmp6_);
1509                         if (!_tmp7_) {
1510                                 break;
1511                         }
1512                         _tmp8_ = _element_it;
1513                         _tmp9_ = gee_iterator_get (_tmp8_);
1514                         element = (gulong) ((guintptr) _tmp9_);
1515                         _tmp10_ = array;
1516                         _tmp10__length1 = array_length1;
1517                         _tmp11_ = index;
1518                         index = _tmp11_ + 1;
1519                         _tmp12_ = element;
1520                         _tmp10_[_tmp11_] = _tmp12_;
1521                         _tmp13_ = _tmp10_[_tmp11_];
1522                 }
1523                 _g_object_unref0 (_element_it);
1524         }
1525         _tmp14_ = array;
1526         _tmp14__length1 = array_length1;
1527         if (result_length1) {
1528                 *result_length1 = _tmp14__length1;
1529         }
1530         result = _tmp14_;
1531         return result;
1532 }
1533
1534
1535 static gfloat* _float_dup (gfloat* self) {
1536         gfloat* dup;
1537         dup = g_new0 (gfloat, 1);
1538         memcpy (dup, self, sizeof (gfloat));
1539         return dup;
1540 }
1541
1542
1543 static gpointer __float_dup0 (gpointer self) {
1544         return self ? _float_dup (self) : NULL;
1545 }
1546
1547
1548 static gfloat** gee_collection_to_float_array (GeeCollection* coll, int* result_length1) {
1549         gfloat** result = NULL;
1550         GeeCollection* _tmp0_;
1551         gint _tmp1_;
1552         gint _tmp2_;
1553         gfloat** _tmp3_ = NULL;
1554         gfloat** array;
1555         gint array_length1;
1556         gint _array_size_;
1557         gint index;
1558         gfloat** _tmp17_;
1559         gint _tmp17__length1;
1560         g_return_val_if_fail (coll != NULL, NULL);
1561         _tmp0_ = coll;
1562         _tmp1_ = gee_collection_get_size (_tmp0_);
1563         _tmp2_ = _tmp1_;
1564         _tmp3_ = g_new0 (gfloat*, _tmp2_);
1565         array = _tmp3_;
1566         array_length1 = _tmp2_;
1567         _array_size_ = array_length1;
1568         index = 0;
1569         {
1570                 GeeCollection* _tmp4_;
1571                 GeeIterator* _tmp5_ = NULL;
1572                 GeeIterator* _element_it;
1573                 _tmp4_ = coll;
1574                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1575                 _element_it = _tmp5_;
1576                 while (TRUE) {
1577                         GeeIterator* _tmp6_;
1578                         gboolean _tmp7_ = FALSE;
1579                         GeeIterator* _tmp8_;
1580                         gpointer _tmp9_ = NULL;
1581                         gfloat* _tmp10_;
1582                         gfloat _tmp11_;
1583                         gfloat element;
1584                         gfloat** _tmp12_;
1585                         gint _tmp12__length1;
1586                         gint _tmp13_;
1587                         gfloat _tmp14_;
1588                         gfloat* _tmp15_;
1589                         gfloat* _tmp16_;
1590                         _tmp6_ = _element_it;
1591                         _tmp7_ = gee_iterator_next (_tmp6_);
1592                         if (!_tmp7_) {
1593                                 break;
1594                         }
1595                         _tmp8_ = _element_it;
1596                         _tmp9_ = gee_iterator_get (_tmp8_);
1597                         _tmp10_ = (gfloat*) _tmp9_;
1598                         _tmp11_ = *_tmp10_;
1599                         _g_free0 (_tmp10_);
1600                         element = _tmp11_;
1601                         _tmp12_ = array;
1602                         _tmp12__length1 = array_length1;
1603                         _tmp13_ = index;
1604                         index = _tmp13_ + 1;
1605                         _tmp14_ = element;
1606                         _tmp15_ = __float_dup0 (&_tmp14_);
1607                         _g_free0 (_tmp12_[_tmp13_]);
1608                         _tmp12_[_tmp13_] = _tmp15_;
1609                         _tmp16_ = _tmp12_[_tmp13_];
1610                 }
1611                 _g_object_unref0 (_element_it);
1612         }
1613         _tmp17_ = array;
1614         _tmp17__length1 = array_length1;
1615         if (result_length1) {
1616                 *result_length1 = _tmp17__length1;
1617         }
1618         result = _tmp17_;
1619         return result;
1620 }
1621
1622
1623 static gdouble* _double_dup (gdouble* self) {
1624         gdouble* dup;
1625         dup = g_new0 (gdouble, 1);
1626         memcpy (dup, self, sizeof (gdouble));
1627         return dup;
1628 }
1629
1630
1631 static gpointer __double_dup0 (gpointer self) {
1632         return self ? _double_dup (self) : NULL;
1633 }
1634
1635
1636 static gdouble** gee_collection_to_double_array (GeeCollection* coll, int* result_length1) {
1637         gdouble** result = NULL;
1638         GeeCollection* _tmp0_;
1639         gint _tmp1_;
1640         gint _tmp2_;
1641         gdouble** _tmp3_ = NULL;
1642         gdouble** array;
1643         gint array_length1;
1644         gint _array_size_;
1645         gint index;
1646         gdouble** _tmp17_;
1647         gint _tmp17__length1;
1648         g_return_val_if_fail (coll != NULL, NULL);
1649         _tmp0_ = coll;
1650         _tmp1_ = gee_collection_get_size (_tmp0_);
1651         _tmp2_ = _tmp1_;
1652         _tmp3_ = g_new0 (gdouble*, _tmp2_);
1653         array = _tmp3_;
1654         array_length1 = _tmp2_;
1655         _array_size_ = array_length1;
1656         index = 0;
1657         {
1658                 GeeCollection* _tmp4_;
1659                 GeeIterator* _tmp5_ = NULL;
1660                 GeeIterator* _element_it;
1661                 _tmp4_ = coll;
1662                 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1663                 _element_it = _tmp5_;
1664                 while (TRUE) {
1665                         GeeIterator* _tmp6_;
1666                         gboolean _tmp7_ = FALSE;
1667                         GeeIterator* _tmp8_;
1668                         gpointer _tmp9_ = NULL;
1669                         gdouble* _tmp10_;
1670                         gdouble _tmp11_;
1671                         gdouble element;
1672                         gdouble** _tmp12_;
1673                         gint _tmp12__length1;
1674                         gint _tmp13_;
1675                         gdouble _tmp14_;
1676                         gdouble* _tmp15_;
1677                         gdouble* _tmp16_;
1678                         _tmp6_ = _element_it;
1679                         _tmp7_ = gee_iterator_next (_tmp6_);
1680                         if (!_tmp7_) {
1681                                 break;
1682                         }
1683                         _tmp8_ = _element_it;
1684                         _tmp9_ = gee_iterator_get (_tmp8_);
1685                         _tmp10_ = (gdouble*) _tmp9_;
1686                         _tmp11_ = *_tmp10_;
1687                         _g_free0 (_tmp10_);
1688                         element = _tmp11_;
1689                         _tmp12_ = array;
1690                         _tmp12__length1 = array_length1;
1691                         _tmp13_ = index;
1692                         index = _tmp13_ + 1;
1693                         _tmp14_ = element;
1694                         _tmp15_ = __double_dup0 (&_tmp14_);
1695                         _g_free0 (_tmp12_[_tmp13_]);
1696                         _tmp12_[_tmp13_] = _tmp15_;
1697                         _tmp16_ = _tmp12_[_tmp13_];
1698                 }
1699                 _g_object_unref0 (_element_it);
1700         }
1701         _tmp17_ = array;
1702         _tmp17__length1 = array_length1;
1703         if (result_length1) {
1704                 *result_length1 = _tmp17__length1;
1705         }
1706         result = _tmp17_;
1707         return result;
1708 }
1709
1710
1711 /**
1712  * Returns an immutable empty collection.
1713  *
1714  * @return an immutable empty collection
1715  */
1716 GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
1717         GeeCollection* result = NULL;
1718         GeeHashSet* _tmp0_;
1719         GeeHashSet* _tmp1_;
1720         GeeSet* _tmp2_;
1721         GeeSet* _tmp3_;
1722         GeeCollection* _tmp4_;
1723         _tmp0_ = gee_hash_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL);
1724         _tmp1_ = _tmp0_;
1725         _tmp2_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp1_);
1726         _tmp3_ = _tmp2_;
1727         _tmp4_ = (GeeCollection*) _tmp3_;
1728         _g_object_unref0 (_tmp1_);
1729         result = _tmp4_;
1730         return result;
1731 }
1732
1733
1734 gint gee_collection_get_size (GeeCollection* self) {
1735         g_return_val_if_fail (self != NULL, 0);
1736         return GEE_COLLECTION_GET_INTERFACE (self)->get_size (self);
1737 }
1738
1739
1740 gboolean gee_collection_get_is_empty (GeeCollection* self) {
1741         g_return_val_if_fail (self != NULL, FALSE);
1742         return GEE_COLLECTION_GET_INTERFACE (self)->get_is_empty (self);
1743 }
1744
1745
1746 static gboolean gee_collection_real_get_is_empty (GeeCollection* base) {
1747         gboolean result;
1748         GeeCollection* self;
1749         gint _tmp0_;
1750         gint _tmp1_;
1751         self = base;
1752         _tmp0_ = gee_collection_get_size (self);
1753         _tmp1_ = _tmp0_;
1754         result = _tmp1_ == 0;
1755         return result;
1756 }
1757
1758
1759 gboolean gee_collection_get_read_only (GeeCollection* self) {
1760         g_return_val_if_fail (self != NULL, FALSE);
1761         return GEE_COLLECTION_GET_INTERFACE (self)->get_read_only (self);
1762 }
1763
1764
1765 GeeCollection* gee_collection_get_read_only_view (GeeCollection* self) {
1766         g_return_val_if_fail (self != NULL, NULL);
1767         return GEE_COLLECTION_GET_INTERFACE (self)->get_read_only_view (self);
1768 }
1769
1770
1771 static void gee_collection_base_init (GeeCollectionIface * iface) {
1772         static gboolean initialized = FALSE;
1773         if (!initialized) {
1774                 initialized = TRUE;
1775                 /**
1776                  * The number of items in this collection.
1777                  */
1778                 g_object_interface_install_property (iface, 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));
1779                 /**
1780                  * Specifies whether this collection can change - i.e. wheather {@link add},
1781                  * {@link remove} etc. are legal operations.
1782                  */
1783                 g_object_interface_install_property (iface, 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));
1784                 /**
1785                  * The read-only view of this collection.
1786                  */
1787                 g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_COLLECTION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1788                 iface->add_all = gee_collection_real_add_all;
1789                 iface->contains_all = gee_collection_real_contains_all;
1790                 iface->remove_all = gee_collection_real_remove_all;
1791                 iface->retain_all = gee_collection_real_retain_all;
1792                 iface->to_array = gee_collection_real_to_array;
1793                 iface->get_is_empty = gee_collection_real_get_is_empty;
1794         }
1795 }
1796
1797
1798 /**
1799  * A generic collection of objects.
1800  */
1801 GType gee_collection_get_type (void) {
1802         static volatile gsize gee_collection_type_id__volatile = 0;
1803         if (g_once_init_enter (&gee_collection_type_id__volatile)) {
1804                 static const GTypeInfo g_define_type_info = { sizeof (GeeCollectionIface), (GBaseInitFunc) gee_collection_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
1805                 GType gee_collection_type_id;
1806                 gee_collection_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeCollection", &g_define_type_info, 0);
1807                 g_type_interface_add_prerequisite (gee_collection_type_id, GEE_TYPE_ITERABLE);
1808                 g_once_init_leave (&gee_collection_type_id__volatile, gee_collection_type_id);
1809         }
1810         return gee_collection_type_id__volatile;
1811 }
1812
1813
1814 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1815         if ((array != NULL) && (destroy_func != NULL)) {
1816                 int i;
1817                 for (i = 0; i < array_length; i = i + 1) {
1818                         if (((gpointer*) array)[i] != NULL) {
1819                                 destroy_func (((gpointer*) array)[i]);
1820                         }
1821                 }
1822         }
1823 }
1824
1825
1826 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1827         _vala_array_destroy (array, array_length, destroy_func);
1828         g_free (array);
1829 }
1830
1831
1832