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

27
LINES

< > BotCompany Repo | #1023548 // mapI_closeable - apply a function to a closeable iterator

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

Transpiled version (1640L) is out of date.

1  
sclass mapI_closeable_It extends CloseableIterableIterator {
2  
  O f;
3  
  CloseableIterableIterator i;
4  
  
5  
  *() {}
6  
  *(O *f, CloseableIterableIterator *i) {}
7  
  
8  
  public bool hasNext() {
9  
    ret i.hasNext();
10  
  }
11  
  
12  
  public O next() {
13  
    ret callF(f, i.next());
14  
  }
15  
  
16  
  toString {
17  
    ret formatFunctionCall('mapI_closeable, f, i);
18  
  }
19  
  
20  
  public void close() throws Exception {
21  
    i.close();
22  
  }
23  
}
24  
25  
static CloseableIterableIterator mapLike mapI_closeable(final O f, final CloseableIterableIterator i) {
26  
  ret mapI_closeable_It(f, i);
27  
}

Author comment

Began life as a copy of #1004292

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: #1023548
Snippet name: mapI_closeable - apply a function to a closeable iterator
Eternal ID of this version: #1023548/5
Text MD5: 6b840b4bdc1047774eafad03066c0946
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-28 00:32:12
Source code size: 562 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 209 / 283
Version history: 4 change(s)
Referenced in: [show references]