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

12
LINES

< > BotCompany Repo | #1028141 - keysWithValueThat - filter on value predicate

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

Transpiled version (2481L) is out of date.

static <A, B> L<A> keysWithValueThat(IPred<B> pred, Map<A, B> map) {
  if (map == null) null;
  new L<A> l;
  for (Map.Entry<A, B> e : map.entrySet())
    if (pred.get(e.getValue()))
      l.add(e.getKey());
  ret l;
}

static <A, B> L<A> keysWithValueThat(Map<A, B> map, IPred<B> pred) {
  ret keysWithValueThat(pred, map);
}

Author comment

Began life as a copy of #1008062

download  show line numbers  debug dex   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028141
Snippet name: keysWithValueThat - filter on value predicate
Eternal ID of this version: #1028141/2
Text MD5: 282ca1f3a17b05ee7165e29ec1e3d65f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-23 13:52:04
Source code size: 333 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 33 / 59
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1028141 & http://1028141.tinybrain.de