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

7
LINES

< > BotCompany Repo | #1036492 // takeLastFromIterator

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

Libraryless. Click here for Pure Java version (10032L/55K).

static <A> L<A> takeLastFromIterator(int n, Iterator<A> it) {
  SimpleCircularBuffer buf = new(n);
  if (it != null)
    while (it.hasNext())
      buf.add(it.next());
  ret buf.asList();
}

Author comment

Began life as a copy of #1003099

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1036492
Snippet name: takeLastFromIterator
Eternal ID of this version: #1036492/3
Text MD5: 81217582bd275b3b800f68559134e8ca
Transpilation MD5: 366bb82b980137ff22f77d9589815a41
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-20 21:08:45
Source code size: 195 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 188 / 225
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)