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

21
LINES

< > BotCompany Repo | #1002425 - runTranslatorQuick

JavaX fragment (include)

static new Map<S, Class> runTranslatorQuick_cache;

static synchronized S runTranslatorQuick(S text, S translatorID) {
  translatorID = formatSnippetID(translatorID);
  Class c = runTranslatorQuick_cache.get(translatorID);
  print("runTranslatorQuick " + programID() + " " + identityHashCode(main.class) + " CACHE " + identityHashCode(runTranslatorQuick_cache) + " " + structure(runTranslatorQuick_cache.keySet()) + " " + (c != null ? "CACHED" : "LOAD") + ": " + translatorID);
  if (c == null) {
    //printStackTrace();
    c = hotwire(translatorID);
    print("runTranslatorQuick " + programID() + " " + identityHashCode(main.class) + " CACHE " + identityHashCode(runTranslatorQuick_cache) + " " + structure(runTranslatorQuick_cache.keySet()) + " STORE: " + translatorID + " " + identityHashCode(c));
    runTranslatorQuick_cache.put(translatorID, c);
  }
  
  set(c, "mainJava", text);
  callMain(c);
  ret (S) get(c, "mainJava");
}

static L<S> runTranslatorQuick(L<S> tok, S translatorID) {
  ret javaTok(runTranslatorQuick(join(tok), translatorID));
}

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1002425
Snippet name: runTranslatorQuick
Eternal ID of this version: #1002425/1
Text MD5: d1c5e7590645083ee290c7cff9742c86
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-22 03:12:33
Source code size: 1080 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 439 / 1549
Referenced in: [show references]

Formerly at http://tinybrain.de/1002425 & http://1002425.tinybrain.de