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

16
LINES

< > BotCompany Repo | #1011466 // SortedCondensedStrings2

JavaX fragment (include)

sclass SortedCondensedStrings2 extends CondensedStrings2 {
  *() {}
  
  *(L<S> l) {
    super(sorted(l));
  }
  
  public int indexOf(O o) {
    if (!o instanceof S) ret -1;
    ret max(-1, Collections.binarySearch(this, (S) o));
  }
  
  public bool contains(O o) {
    ret indexOf(o) >= 0;
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1011466
Snippet name: SortedCondensedStrings2
Eternal ID of this version: #1011466/2
Text MD5: e0ee819a6aa808b15b19bea89bc70439
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-29 23:16:11
Source code size: 313 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 498 / 1639
Version history: 1 change(s)
Referenced in: [show references]