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

16
LINES

< > BotCompany Repo | #1011466 // SortedCondensedStrings2

JavaX fragment (include)

1  
sclass SortedCondensedStrings2 extends CondensedStrings2 {
2  
  *() {}
3  
  
4  
  *(L<S> l) {
5  
    super(sorted(l));
6  
  }
7  
  
8  
  public int indexOf(O o) {
9  
    if (!o instanceof S) ret -1;
10  
    ret max(-1, Collections.binarySearch(this, (S) o));
11  
  }
12  
  
13  
  public bool contains(O o) {
14  
    ret indexOf(o) >= 0;
15  
  }
16  
}

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: 500 / 1642
Version history: 1 change(s)
Referenced in: [show references]