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).

static <A> Set<A> filterSet(Iterable<A> c, IPred<A> pred) {
  Set<A> x = similarEmptySetOrLinkedHashSet(c);
  if (c != null) for (A o : c)
    if (pred.get(o))
      x.add(o);
  ret x;
}

static <A> Set<A> lambdaMapLike filterSet(IPred<A> pred, Iterable<A> c) {
  ret filterSet(c, pred);
}

Author comment

Began life as a copy of #1021399

download  show line numbers  debug dex   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, 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: 27 / 59
Version history: 4 change(s)
Referenced in: [show references]

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