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

24
LINES

< > BotCompany Repo | #1024489 // agiBlue_findProbableConcreteSlicesForMetaSlices

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

Libraryless. Click here for Pure Java version (4039L/27K).

static SS agiBlue_findProbableConcreteSlicesForMetaSlices() {
  new SS metaToConcrete; // id to id
  
  SS idToName = agiBlue_sliceNamesMap();
  MultiMap<S> nameToID = reversedMapAsMultiMap(idToName);
  for (S metaID, metaName : idToName) {
    S name = dropSuffixICOrNull_trim("[Meta]", metaName);
    if (name == null) continue;
    S concrete = agiBlue_concreteSliceOfMetaSlice(metaID);
    if (nempty(concrete))
      continue with print("Found defined concrete slice for meta slice " + metaID + "/" + metaName + ": " + concrete);
      
    LS ids = nameToID.get(name);
    if (empty(ids))
      print("Concrete slice for meta slice " + metaID + "/" + metaName + " not found");
    else if (l(ids) > 1)
      print("Multiple possible concrete slices for meta slice " + metaID + "/" + metaName + ": " + ids);
    else {
      print("Found concrete slice for meta slice " + metaID + "/" + metaName + ": " + first(ids));
      metaToConcrete.put(metaID, first(ids));
    }
  }
  ret metaToConcrete;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024489
Snippet name: agiBlue_findProbableConcreteSlicesForMetaSlices
Eternal ID of this version: #1024489/4
Text MD5: a0fc6a6e4d3afdfb8b9e133463a65dd9
Transpilation MD5: dff0ea9f6d611cedc0adb2ad08fd1e4b
Author: stefan
Category: javax / agi.blue
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-14 12:37:35
Source code size: 1025 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 200 / 285
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)