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

11
LINES

< > BotCompany Repo | #1035249 // antiFilterToSet - drop where predicate matches

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

Libraryless. Click here for Pure Java version (7904L/44K).

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

static <A, B extends A> Set<B> antiFilterToSet(IPred<A> pred, Iterable<B> c) {
  ret antiFilterToSet(c, pred);
}

Author comment

Began life as a copy of #1017203

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035249
Snippet name: antiFilterToSet - drop where predicate matches
Eternal ID of this version: #1035249/1
Text MD5: 095bbcc92f2fcef5647fe241e6c12c36
Transpilation MD5: f705b13a86557e5bd080850c8bde341d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-27 11:29:56
Source code size: 317 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 61 / 81
Referenced in: [show references]