[Vala] Does Vala.HashMap works ?
- From: "G.S.Alex" <sthots gmail com>
- To: vala-list gnome org
- Subject: [Vala] Does Vala.HashMap works ?
- Date: Mon, 4 Jan 2010 14:05:34 +0800
this code is almost the same with the libgee example.
but the value haspmap will always be 0 for int , (null) for string.
--------------------------------------------------------------------------------------------------------------
using Vala;
static int main (string[] args) {
var map = new Vala.HashMap<string, int> ();
map.set ("one", 1);
map.set ("two", 2);
map.set ("three", 3);
map["four"] = 4; // same as map.set ("four", 4)
map["five"] = 5;
// foreach (string key in map.keys) {
stdout.printf ("%d\n", map["two"]); // same as map.get (key)
// }
return 0;
}
--------------------------------------------------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]