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

15
LINES

< > BotCompany Repo | #1014222 // wordTreeAdd

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

Transpiled version (2556L) is out of date.

svoid wordTreeAdd(MapSO tree, Cl<S> words, O value) {
  fOr (S word : words) {
    O child = tree.get(word);
    Map<S, O> subTree;
    if (child instanceof Map)
      tree = (Map) child;
    else {
      tree.put(word, subTree = ciMap());
      if (child != null)
        subTree.put("<default>", child);
      tree = subTree;
    }
  }
  tree.put("<default>", value);
}

Author comment

Began life as a copy of #1014221

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014222
Snippet name: wordTreeAdd
Eternal ID of this version: #1014222/9
Text MD5: f1f11b6ef5aecf387f934707e8ea9ba4
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-06 20:52:36
Source code size: 385 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 393 / 481
Version history: 8 change(s)
Referenced in: [show references]