static <A> L<A> filterByType(Iterable c, Class<A> type) { new L<A> l; if (c != null) for (O x : c) if (isInstanceX(type, x)) l.add((A) x); ret l; } static <A> L<A> filterByType(O[] c, Class<A> type) { ret filterByType(asList(c), type); } static <A> L<A> filterByType(Class<A> type, Iterable c) { ret filterByType(c, type); }
Began life as a copy of #1002319
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004806 |
Snippet name: | filterByType - only return instances of some class from collection |
Eternal ID of this version: | #1004806/4 |
Text MD5: | d95ef555486b5c2e41ffbbcd4bb4a4f8 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-07-06 18:24:03 |
Source code size: | 360 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 621 / 639 |
Version history: | 3 change(s) |
Referenced in: | #1004819 - hasType - does collection include an object of some type? #1004821 - firstOfType - return first element of collection that is of some type #1004838 - filterByDynamicType #1005053 - filterNempty - only non-empty strings #1006654 - Standard functions list 2 (LIVE, continuation of #761) |