Skip to content

Collections

C#: System.Collections.Generic namespace

Vala: Gee namespace, --pkg gee-1.0, Libgee

Rough equivalents:

Classes:

System.Collections.GenericGee
DictionaryHashMap
HashSetHashSet
LinkedListLinkedList
ListArrayList
QueueLinkedList, PriorityQueue
SortedDictionaryTreeMap
StackLinkedList

Interfaces:

System.Collections.GenericGee
ICollectionCollection
IComparerComparable
IDictionaryMap
IEnumerableIterable
IEnumeratorIterator
IListList, Queue, Deque

See Gee Examples

You can access and assign Gee collection items via indexers (e.g. my_map[key] is equivalent to my_map.get (key)). Vala supports an in operator for collections: x in my_collection is equivalent to my_collection.contains (x). This operator also works with strings, even though strings are not collections.

Please note that Libgee checks for errors like the bounds for the index key with an assert, and so it won't raise any catchable SystemException like in C#.