Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1003047 // collect - extended synonym of collectField

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2507L/16K).

static L collect(Iterable c, S field) {
  ret collectField(c, field);
}

static L mapMethodLike collect(S field, Iterable c) {
  ret collectField(c, field);
}

/*ifclass Concept
static L collect(Class c, S field) {
  ret collect(list(c), field);
}
endif
TODO: make translator ignore stuff in ifclass until resolved
*/

Author comment

Began life as a copy of #1002318

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, podlckwnjdmb, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1003047
Snippet name: collect - extended synonym of collectField
Eternal ID of this version: #1003047/8
Text MD5: 5e79132f7af6f060d99f26f1d7e96543
Transpilation MD5: a9d48de2d53c3498083560e5986620d9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-21 00:14:38
Source code size: 331 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 857 / 1341
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1013929 - mapField - synonym of collect
#1019164 - syncCollect - collect field + synchronize on list
#1021464 - collectNonNulls
#1022060 - lazyCollect - collect field through a lazy list
#1022211 - pairsCollect - collect field in both sides of pair
#1023707 - ccollect - collect field from concepts list
#1024147 - collectMulti_notNulls - collect multiple fields as L<Map<S, O>>, skip null values
#1028356 - collectSorted - collect field + sort
#1028460 - collectStrings - stringsOnly + collect
#1032576 - collectMapValues_gen
#3000382 - Answer for ferdie (>> t = 1, f = 0)