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


< > BotCompany Repo | #1010472 - setMinusSet - set minus some elements

JavaX fragment (include)

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

static <A, B extends A> Set<A> setMinusSet(Cl<A> l, Collection<B> stuff) {
  ret setMinusSet(asSet(l), stuff);

Author comment

Began life as a copy of #1007796

download  show line numbers  debug dex   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1010472
Snippet name: setMinusSet - set minus some elements
Eternal ID of this version: #1010472/4
Text MD5: 382b3424d3b1e8f95b4b15abfbac6d0f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-19 14:32:40
Source code size: 352 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 264 / 271
Version history: 3 change(s)
Referenced in: [show references]

Formerly at &