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).

static class Matches {
  String[] m;
  
  *() {}
  *(S... *m) {}
  
  String get(int i) { return i < m.length ? m[i] : null; }
  String unq(int i) { return unquote(get(i)); }
  String fsi(int i) { return formatSnippetID(unq(i)); }
  String fsi() { return fsi(0); }
  String tlc(int i) { return unq(i).toLowerCase(); }
  boolean bool(int i) { return "true".equals(unq(i)); }
  String rest() { return m[m.length-1]; } // for matchStart
  int psi(int i) { return Integer.parseInt(unq(i)); }
  
  toString { ret "Matches(" + joinWithComma(quoteAll(asList(m))) + ")"; }
  
  public int hashCode() { ret _hashCode(toList(m)); }
  public bool equals(O o) { ret o instanceof Matches && arraysEqual(m, o/Matches.m); }
}

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: 534 / 18406
Version history: 8 change(s)
Referenced in: [show references]