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

15
LINES

< > BotCompany Repo | #1000381 // L<S> (translator)

JavaX translator [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1624L/10K).

1  
!636
2  
!quicktranslator
3  
!class JavaTok
4  
5  
// replace L<S> with List<String>
6  
// and L<X> with List<X>
7  
List<String> tok = JavaTok.split(s);
8  
for (int i = 1; i+6 < tok.size(); i += 2)
9  
  if (tok.get(i).equals("L") && tok.get(i+2).equals("<")
10  
    && tok.get(i+6).equals(">")) {
11  
    tok.set(i, "List");
12  
    if (tok.get(i+4).equals("S"))
13  
      tok.set(i+4, "String");
14  
  }
15  
s = JavaTok.join(tok);

Author comment

Began life as a copy of #680

download  show line numbers  debug dex  old transpilations   

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

Comments [hide]

ID Author/Program Comment Date
615 #1000610 Edit suggestion:
!636
!629

main {
static Object androidContext;
static String programID;

public static void main(String[] args) throws Exception {
!636
!quicktranslator
!class JavaTok

// replace L<S> with List<String>
// and L<X> with List<X>
List<String> tok = JavaTok.split(s);
for (int i = 1; i+6 < tok.size(); i += 2)
if (tok.get(i).equals("L") && tok.get(i+2).equals("<")
&& tok.get(i+6).equals(">")) {
tok.set(i, "List");
if (tok.get(i+4).equals("S"))
tok.set(i+4, "String");
}
s = JavaTok.join(tok);
}}
2015-08-19 00:52:41  delete 
613 #1000604 (pitcher) 2015-08-18 00:07:22

add comment

Snippet ID: #1000381
Snippet name: L<S> (translator)
Eternal ID of this version: #1000381/1
Text MD5: af233246334612410d9c7b4bef318d04
Transpilation MD5: 6369fa4c60098e0a363c7abd7003406e
Author: stefan
Category: javax
Type: JavaX translator
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-07-31 08:48:50
Source code size: 396 bytes / 15 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 1378 / 1697
Referenced in: [show references]