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

28
LINES

< > BotCompany Repo | #687 // Object call manager (developing)

JavaX source code - run with: x30.jar

1  
!636
2  
!class JavaTok
3  
4  
main {
5  
  psvm {
6  
    String input = "javatok [1] length";
7  
    String[] parts = input.split(" ");
8  
    Object in = "\"some text\"";
9  
    for (String part : parts) {
10  
      System.out.println("Object: " + in + "-> " + part);
11  
      in = runPart(part, in);
12  
    }
13  
    in = String.valueOf(in);
14  
    System.out.println("Object: " + in);
15  
    String result = String.valueOf(in);
16  
    System.out.println("Result: " + result);
17  
  }
18  
  
19  
  static Object runPart(String part, Object in) {
20  
    if (part.equals("javatok"))
21  
      return JavaTok.split((String) in);
22  
    if (part.equals("[1]"))
23  
      return ((List) in).get(1);
24  
    if (part.equals("length"))
25  
      return ((String) in).length();
26  
    throw new RuntimeException("Unknown part: " + part);
27  
  }
28  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #687
Snippet name: Object call manager (developing)
Eternal ID of this version: #687/1
Text MD5: ff9cef25906babaa211cd27ef8ce9e7c
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-07-27 17:21:17
Source code size: 779 bytes / 28 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 601 / 594
Referenced in: [show references]