get_length
Description:
Returns the positive length (>= 0) of this.
Note that this method is O(h) where `h' is the height of the tree. It is thus more efficient to use is_empty when comparing the length to zero.
Example: Get the length:
public static int main (string[] args) {
Sequence<string> seq = new Sequence<string> ();
seq.prepend ("amet");
seq.prepend ("sit");
seq.prepend ("dolor");
seq.prepend ("ipsum");
seq.prepend ("Lorem");
// Output: ``5``
print ("%d\n", seq.get_length ());
return 0;
}
valac --pkg glib-2.0 GLib.Sequence.get_length.vala
Parameters:
this |
a Sequence |
Returns:
the length of this |