Stream


Object Hierarchy:

Object hierarchy for Stream

Description:

public class Stream<T> : Object

A fluent pipeline for transforming and aggregating collection data.

Stream provides a chainable API for filter, map, sort, distinct, limit/skip, and terminal operations like reduce, count, and findFirst. Most intermediate operations return a new Stream, except peek which returns the same instance for chaining. Terminal operations produce a final result.

Example:

    var list = new ArrayList<string> (GLib.str_equal);
list.add ("banana");
list.add ("apple");
list.add ("cherry");

var result = Stream.fromList<string> (list)
.filter ((s) => { return s.length > 5; })
.sorted ((a, b) => { return strcmp (a, b); })
.toList ();
// result: ["banana", "cherry"]


Namespace: Vala.Collections
Package: Valacore

Content:

Static methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object