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

27
LINES

< > BotCompany Repo | #1022322 // Gazelle: Recently used mappings

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (9373L/49K).

1  
!7
2  
3  
concept RUM {
4  
  S context;
5  
  S ruleID;
6  
  SS varMap;
7  
}
8  
9  
cmodule RecentlyUsedMappings > DynCRUD<RUM> {
10  
  start {
11  
    dbIndexing(RUM, 'context);
12  
  }
13  
  
14  
  // API
15  
  
16  
  L<SS> getRecentlyUsedMappings(S context, S ruleID) {
17  
    ret collect varMap(conceptsWhere RUM(+context, +ruleID));
18  
  }
19  
  
20  
  void storeRecentlyUsedMapping(S context, S ruleID, SS varMap) {
21  
    uniq_sync RUM(+context, +ruleID, varMap := asCIMap(varMap));
22  
  }
23  
  
24  
  bool hasRecentlyUsedMapping(S context, S ruleID, SS varMap) {
25  
    ret findConceptWhere RUM(+context, +ruleID, varMap := asCIMap(varMap)) != null;
26  
  }
27  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1022322
Snippet name: Gazelle: Recently used mappings
Eternal ID of this version: #1022322/8
Text MD5: a6cf813c5ce761f9316a6999fd893f8e
Transpilation MD5: 4742a026dce4859994bff4cf707f4391
Author: stefan
Category: javax / gazelle
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-14 10:44:24
Source code size: 606 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 216 / 3147
Version history: 7 change(s)
Referenced in: [show references]