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

28
LINES

< > BotCompany Repo | #1012286 // allWebsByID before SmallestListMultiMap

JavaX fragment (include)

static DependentCache<MultiMap<GlobalID, Web>> allWebsByID_cache = new DependentCache(f allWebsByID_calc, f cachedNodeIndex /*_changeCount*/);

static MultiMap<GlobalID, Web> allWebsByID() {
  ret allWebsByID_cache!;
}

static MultiMap<GlobalID, Web> allWebsByID_calc() {
  setAdd(postSoftwareMadeWeb_onNewWeb, f allWebsByID_onNewWeb);
  onTransientWebAdded_do(f allWebsByID_onNewWeb);
  onTransientWebRemoved_do(f allWebsByID_onRemovedWeb);
  ret multiMapIndexByMethod(allWebsFromCachedNodeIndex_uncached(), 'globalIDObj);
}

svoid allWebsByID_onNewWeb(Web web, O[] params) {
  allWebsByID_onNewWeb(web);
}

svoid allWebsByID_onNewWeb(Web web) {
  lock allWebsByID_cache.lock;
  if (allWebsByID_cache! != null)
    allWebsByID_cache->put(web.globalIDObj(), web);
}

svoid allWebsByID_onRemovedWeb(Web web) {
  lock allWebsByID_cache.lock;
  if (allWebsByID_cache! != null)
    allWebsByID_cache->remove(web.globalIDObj());
}

Author comment

Began life as a copy of #1011311

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012286
Snippet name: allWebsByID before SmallestListMultiMap
Eternal ID of this version: #1012286/1
Text MD5: fc5e26048a9bbd1097844170e29c9c95
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-27 11:04:01
Source code size: 952 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 255 / 297
Referenced in: [show references]