D-Bus: Fix Connection.get_proxy.begin calls
[vala-lang.git] / gee / collection.vala
blob6a652fcdfd41cddf804264f8158c91aef206c946
1 /* collection.vala
3 * Copyright (C) 2007 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * Author:
20 * Jürg Billeter <j@bitron.ch>
23 /**
24 * Serves as the base interface for implementing collection classes. Defines
25 * size, iteration, and modification methods.
27 public abstract class Vala.Collection<G> : Iterable<G> {
28 /**
29 * The number of items in this collection.
31 public abstract int size { get; }
33 /**
34 * Determines whether this collection contains the specified item.
36 * @param item the item to locate in the collection
38 * @return true if item is found, false otherwise
40 public abstract bool contains (G item);
42 /**
43 * Adds an item to this collection. Must not be called on read-only
44 * collections.
46 * @param item the item to add to the collection
48 * @return true if the collection has been changed, false otherwise
50 public abstract bool add (G item);
52 /**
53 * Removes the first occurence of an item from this collection. Must not
54 * be called on read-only collections.
56 * @param item the item to remove from the collection
58 * @return true if the collection has been changed, false otherwise
60 public abstract bool remove (G item);
62 /**
63 * Removes all items from this collection. Must not be called on
64 * read-only collections.
66 public abstract void clear ();