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

11
LINES

< > BotCompany Repo | #1023844 // filterPairB - filter pairs according to predicate on b

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

Libraryless. Click here for Pure Java version (10045L/55K).

1  
static <A, B> LPair<A, B> filterPairB(IPred<B> pred, Iterable<Pair<A, B>> c) {
2  
  ret filterPairB(c, pred);
3  
}
4  
5  
static <A, B> LPair<A, B> filterPairB(Iterable<Pair<A, B>> c, IPred<B> pred) {
6  
  new LPair<A, B> x;
7  
  if (c != null) for (Pair<A, B> p : c)
8  
    if (p != null && pred.get(p.b))
9  
      x.add(p);
10  
  ret x;
11  
}

Author comment

Began life as a copy of #1003524

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1023844
Snippet name: filterPairB - filter pairs according to predicate on b
Eternal ID of this version: #1023844/6
Text MD5: d5b57443ac89aa88cd2567533a747c2d
Transpilation MD5: a8b831b2e85cb8bd2b36557691d5cf7e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-02-13 19:13:27
Source code size: 322 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 236 / 339
Version history: 5 change(s)
Referenced in: [show references]