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

20
LINES

< > BotCompany Repo | #1001496 - class Matches

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

Libraryless. Click here for Pure Java version (2046L/13K).

1  
static class Matches {
2  
  String[] m;
3  
  
4  
  *() {}
5  
  *(S... *m) {}
6  
  
7  
  String get(int i) { return i < m.length ? m[i] : null; }
8  
  String unq(int i) { return unquote(get(i)); }
9  
  String fsi(int i) { return formatSnippetID(unq(i)); }
10  
  String fsi() { return fsi(0); }
11  
  String tlc(int i) { return unq(i).toLowerCase(); }
12  
  boolean bool(int i) { return "true".equals(unq(i)); }
13  
  String rest() { return m[m.length-1]; } // for matchStart
14  
  int psi(int i) { return Integer.parseInt(unq(i)); }
15  
  
16  
  toString { ret "Matches(" + joinWithComma(quoteAll(asList(m))) + ")"; }
17  
  
18  
  public int hashCode() { ret _hashCode(toList(m)); }
19  
  public bool equals(O o) { ret o instanceof Matches && arraysEqual(m, o/Matches.m); }
20  
}

download  show line numbers  debug dex   

Travelled to 22 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, fehiwqupcyrn, gwrvuhgaqvyk, imzmzdywqqli, ishqpsrjomds, jtubtzbbkimh, lhdilzshxjzv, lnbujpyubztb, lpdgvwnxivlt, lulzaavyztxj, mqqgnosmbjvj, mqsvbyillbrs, onxytkatvevr, ppjhyzlbdabe, sawdedvomwva, tslmcundralx, tvejysmllsmz, whxojlpjdney, wtqryiryparv

No comments. add comment

Snippet ID: #1001496
Snippet name: class Matches
Eternal ID of this version: #1001496/9
Text MD5: a01bc851d169103b76dfa57369f3caea
Transpilation MD5: 5d241d478959160912eeb5cb39d68a6b
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-21 16:00:15
Source code size: 731 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 585 / 18900
Version history: 8 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1001496 & http://1001496.tinybrain.de