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

11
LINES

< > BotCompany Repo | #1028848 // filterSet

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

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

1  
static <A> Set<A> filterSet(Iterable<A> c, IPred<A> pred) {
2  
  Set<A> x = similarEmptySetOrLinkedHashSet(c);
3  
  if (c != null) for (A o : c)
4  
    if (pred.get(o))
5  
      x.add(o);
6  
  ret x;
7  
}
8  
9  
static <A> Set<A> lambdaMapLike filterSet(IPred<A> pred, Iterable<A> c) {
10  
  ret filterSet(c, pred);
11  
}

Author comment

Began life as a copy of #1021399

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1028848
Snippet name: filterSet
Eternal ID of this version: #1028848/5
Text MD5: f452f1096118cd0e4523d2dde3ee1f52
Transpilation MD5: b6571338438acb976643c106297ec532
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-09 17:52:11
Source code size: 299 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 247 / 333
Version history: 4 change(s)
Referenced in: [show references]