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

11
LINES

< > BotCompany Repo | #1004337 // deleteWhere - delete elements of a collection matching certain fields

JavaX fragment (include)

// returns number of deleted elements
static int deleteWhere(Collection c, O... data) {
  int n = 0;
  Iterator i = c.iterator();
  while (i.hasNext())
    if (checkFields(i.next(), data)) {
      i.remove();
      ++n;
    }
  ret n;
}

Author comment

Began life as a copy of #1003173

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004337
Snippet name: deleteWhere - delete elements of a collection matching certain fields
Eternal ID of this version: #1004337/1
Text MD5: 2f3a6bb6c213f6d8cb175f613e2f069e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-13 18:36:20
Source code size: 246 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 446 / 482
Referenced in: [show references]