-
Notifications
You must be signed in to change notification settings - Fork 0
Query Functions
Naoya Komatsu edited this page May 14, 2016
·
13 revisions
-
where(bool predicate(T))
Enumerable.from([10,20,30]).where("_ <= 20"); // => [10, 20]
-
where(bool predicate(T, int))
Enumerable.from([10,20,30]).where("_2 > 1"); // => [30]
-
where(bool predicate(T, int, Args*), Args*)
-
select(T2 selector(T))
Enumerable.from([10,20,30]).select("_ * 2"); // => [20, 40, 60]
-
select(T2 selector(T, int))
Enumerable.from([10,20,30]).select("_2 + ':' + _"); // => ["0:10", "1:20", "2:30"]
-
select(T2 selector(T, int, Args*), Args*)
-
selectMany(T2[] collectionSelector(T))
Enumerable.from([[10,20,30], [1,2]]).selectMany("_"); // => [10, 20, 30, 1, 2]
-
selectMany(T2[] collectionSelector(T, int))
Enumerable.from([[10,20,30], [1,2]]) .selectMany("_.insert(0, 'index:' + index), _"); // => ["index:0", 10, 20, 30, "index:1", 1, 2]
-
selectMany(T2[](T) collectionSelector, T3 resultSelector(T, T2))
Enumerable.from([ %[ name:"a", data:[1,2] ], %[ name:"b", data:[10,20,30] ] ]).selectMany("_.data", "_.name + ':' + _2"); // => ["a:1", "a:2", "b:10", "b:20", "b:30"]
-
selectMany(T2[](T, int) collectionSelector, T3 resultSelector(T, T2))
-
selectMany(T2[](T, int, Args*) collectionSelector, T3 resultSelector(T, T2, Args*), Args*)