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

7
LINES

< > BotCompany Repo | #1022634 // collectionMinusSet - collection minus some elements

JavaX fragment (include)

static <A, B extends A> Collection<A> collectionMinusSet(Collection<A> l, Collection<B> stuff) {
  if (empty(stuff)) ret l;
  Set<B> set = asSet(stuff);
  Collection<A> l2 = similarEmptyCollection(l);
  for (A a : l) if (!set.contains(a)) l2.add(a);
  ret l2;
}

Author comment

Began life as a copy of #1007796

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1022634
Snippet name: collectionMinusSet - collection minus some elements
Eternal ID of this version: #1022634/1
Text MD5: da61d5f23e3537ca0297a77d27cef5c4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-25 13:40:51
Source code size: 267 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 259 / 306
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)