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

6
LINES

< > BotCompany Repo | #1029831 // sortByTransformedMapKey - not the clearest name

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

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

static <B, C, A extends Map<B, C>, D> L<A> lambdaMapLike sortByTransformedMapKey(IF1<C, D> transform, Iterable<A> c, B key) {
  L<A> l = cloneList(c);
  sort(l, (a, b) ->
    stdcompare(transform.get(mapGet(a, key)), transform.get(mapGet(b, key))));
  ret l;
}

Author comment

Began life as a copy of #1021847

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1029831
Snippet name: sortByTransformedMapKey - not the clearest name
Eternal ID of this version: #1029831/6
Text MD5: 77adb76cd5cf662142c378c1aaf5209a
Transpilation MD5: 0f98720e90d90191d2c61cb1446c3809
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-21 13:14:25
Source code size: 265 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 243 / 342
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1029832 - sortByTransformedMapKey_alphaNum