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

25
LINES

< > BotCompany Repo | #1012513 // InterruptibleString - e.g. for interruptible regexp matches

JavaX fragment (include)

1  
static class InterruptibleString implements CharSequence {
2  
   S inner;
3  
4  
   *() {}
5  
   *(S *inner) {}
6  
7  
   @Override
8  
   public char charAt(int index) {
9  
      ping();
10  
      ret inner.charAt(index);
11  
   }
12  
13  
   @Override
14  
   public int length() {
15  
      ret inner.length();
16  
   }
17  
18  
   @Override
19  
   public CharSequence subSequence(int start, int end) {
20  
      ret new InterruptibleString(inner.substring(start, end));
21  
   }
22  
23  
   @Override
24  
   toString { ret inner.toString(); }
25  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012513
Snippet name: InterruptibleString - e.g. for interruptible regexp matches
Eternal ID of this version: #1012513/3
Text MD5: c635c2dee9f4722f5f7ce60b4dd74005
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-06 16:17:37
Source code size: 486 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 477 / 1030
Version history: 2 change(s)
Referenced in: [show references]