[Vala] Personal iterable, collection, list classes



Hi all,

I would like to create a couple of classes and use them as collections.
For example:

public class MyList()
{
 protected List<MyObject> objects = new ArrayList<MyObject>;
 ...
}

public class MyObject()
{
 protected string mydata;
}


And I would like to code like this:

var l = new MyList();
l.populate(blah blah);
foreach(MyObject o in l) {
 printf(o.getData());
}


First of all: is it possible?
And, if yes, how? :)
What classes/interfaces should I inherit from?

Thank you very much.

-- 
Alessandro Pellizzari





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]