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)

static class InterruptibleString implements CharSequence {
   S inner;

   *() {}
   *(S *inner) {}

   @Override
   public char charAt(int index) {
      ping();
      ret inner.charAt(index);
   }

   @Override
   public int length() {
      ret inner.length();
   }

   @Override
   public CharSequence subSequence(int start, int end) {
      ret new InterruptibleString(inner.substring(start, end));
   }

   @Override
   toString { ret inner.toString(); }
}

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: 475 / 1028
Version history: 2 change(s)
Referenced in: [show references]