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

!636
!class JavaTok

main {
  psvm {
    String input = "javatok [1] length";
    String[] parts = input.split(" ");
    Object in = "\"some text\"";
    for (String part : parts) {
      System.out.println("Object: " + in + "-> " + part);
      in = runPart(part, in);
    }
    in = String.valueOf(in);
    System.out.println("Object: " + in);
    String result = String.valueOf(in);
    System.out.println("Result: " + result);
  }
  
  static Object runPart(String part, Object in) {
    if (part.equals("javatok"))
      return JavaTok.split((String) in);
    if (part.equals("[1]"))
      return ((List) in).get(1);
    if (part.equals("length"))
      return ((String) in).length();
    throw new RuntimeException("Unknown part: " + part);
  }
}

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: 600 / 592
Referenced in: [show references]