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

10
LINES

< > BotCompany Repo | #1035286 // subListContains

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

Libraryless. Click here for Pure Java version (62L/1K).

static <A> bool subListContains(L<A> l, int startIndex, int endIndex, A a) {
  if (l == null) false;
  int n = l.size();
  startIndex = Math.max(0, startIndex);
  endIndex = Math.min(n, endIndex);
  for (int i = startIndex; i < endIndex; i++)
    if (eq(a, l.get(i)))
      true;
  false;
}

Author comment

Began life as a copy of #1002310

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035286
Snippet name: subListContains
Eternal ID of this version: #1035286/3
Text MD5: 9c4031ade1db54afe4c09d05a99857ae
Transpilation MD5: 9092ab7bf39e5ba2f64e0ce2eda6157c
Author: stefan
Category: javaxc
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-28 23:40:08
Source code size: 299 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 139 / 191
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)