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

6
LINES

< > BotCompany Repo | #1024443 // iteratorCount_int_close

JavaX fragment (include)

static <A> int iteratorCount_int_close(Iterator<A> i) ctex {
  int n = 0;
  if (i != null) while (i.hasNext()) { i.next(); ++n; }
  if (i cast AutoCloseable) i.close();
  ret n;
}

Author comment

Began life as a copy of #1024442

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, wnsclhtenguj

No comments. add comment

Snippet ID: #1024443
Snippet name: iteratorCount_int_close
Eternal ID of this version: #1024443/3
Text MD5: 716f88556ffdc36d5cb4804f6fdfd9f8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-12 20:55:22
Source code size: 184 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 256 / 367
Version history: 2 change(s)
Referenced in: [show references]