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

22
LINES

< > BotCompany Repo | #1001496 // class Matches

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

Libraryless. Click here for Pure Java version (10034L/55K).

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)); }
  ifdef Matches_fsi
  String fsi(int i) { return formatSnippetID(unq(i)); }
  String fsi() { return fsi(0); }
  endifdef
  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  old transpilations   

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

No comments. add comment

Snippet ID: #1001496
Snippet name: class Matches
Eternal ID of this version: #1001496/10
Text MD5: 5b54074f769b5fa527b3e133833330c4
Transpilation MD5: 7a89fe6837017e135f95a06a72705919
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-02 11:52:06
Source code size: 764 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 978 / 20123
Version history: 9 change(s)
Referenced in: #1002474 - Standard functions (new)
#1003872 - Integrating #759 in One Program
#1003874 - Backup of #759 Before Integration
#1004091 - 759 with new loadClasses (spike)
#1004305 - x31.java (JavaX)
#1006723 - Higher-Level-Transpiled #759 Spike [old]
#1006724 - Backup of #759 before switching to higher-level-translation
#1007595 - "Super-Edgy" JavaX Translator (Extension of #752) [dev., broken]
#1010083 - Backup of "Super-Edgy" JavaX Translator (Extension of #7)
#1010084 - Speeding up "Super-Edgy" JavaX Translator (Extension of #7)
#1010087 - Speeding up "Super-Edgy" JavaX Translator (Extension of #7) 2
#1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)