HashSet


Object Hierarchy:

Object hierarchy for HashSet

Description:

public class HashSet<T> : Object

A hash table-based set of unique elements.

HashSet provides O(1) average-time add, remove, and contains. Inspired by Java's HashSet and Python's set.

Set operations (union, intersection, difference) return new sets without modifying the originals.

Example:

    var set = new HashSet<string> (GLib.str_hash, GLib.str_equal);
set.add ("apple");
set.add ("banana");
set.add ("apple");
assert (set.size () == 2);
assert (set.contains ("apple"));


Namespace: Vala.Collections
Package: Valacore

Content:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object