Collection
Object Hierarchy:
Description:
public interface Collection<G> :
Iterable<
G?>
A generic collection of objects.
Namespace: Gee
Package: gee-1.0
Content:
Static methods:
Properties:
-
public abstract int
size { get; }
The number of items in this collection.
-
public abstract bool
is_empty { get; }
Specifies whether this collection is empty.
-
public abstract Collection<
G?>
read_only_view { owned
get; }
The read-only view of this collection.
Methods:
-
public abstract bool
contains (G? item)
Determines whether this collection contains the specified item.
-
public abstract bool
add (G? item)
Adds an item to this collection. Must not be called on read-only collections.
-
public abstract bool
remove (G? item)
Removes the first occurence of an item from this collection. Must not be called on read-only
collections.
-
public abstract void
clear ()
Removes all items from this collection. Must not be called on read-only collections.
-
public abstract bool
add_all (Collection<
G?> collection)
Adds all items in the input collection to this collection.
-
public abstract bool
contains_all (Collection
<G?> collection)
Returns true it this collection contains all items as the input collection.
-
public abstract bool
remove_all (Collection
<G?> collection)
Removes the subset of items in this collection corresponding to the elements in the input collection. If
there is several occurrences of the same value in this collection they are decremented of the number of occurrences in the input
collection.
-
public abstract bool
retain_all (Collection
<G?> collection)
Removes all items in this collection that are not contained in the input collection. In other words all
common items of both collections are retained in this collection.
-
public abstract G?[]
to_array ()
Returns an array containing all of items from this collection.