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

35
LINES

< > BotCompany Repo | #1015960 // DynModuleRef

JavaX fragment (include)

sclass DynModuleRef {
  S moduleID;
  transient O module;
  
  *() {}
  *(S *moduleID) {}
  
  void _doneLoading() {
    resolve();
  }
  
  void resolve {
    if (module == null && moduleID != null) {
      module = dm_getModule(moduleID);
      //print("Module ID " + moduleID + " resolved to " + className(module));
    }
  }
  
  O get() {
    resolve();
    ret module;
  }
  
  void set(S moduleID) {
    this.moduleID = moduleID;
    module = null;
  }
  
  toString {
    ret moduleID == null ? "-" : moduleID + " (" + shortClassName(module) + ")";
  }
  
  public int hashCode() { ret _hashCode(moduleID); }
  public bool equals(O o) { ret o instanceof DynModuleRef && eq(moduleID, o/DynModuleRef.moduleID); }
}

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: #1015960
Snippet name: DynModuleRef
Eternal ID of this version: #1015960/8
Text MD5: 671ff6fbaa92895f2de0337d00a77b1a
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-03 13:32:29
Source code size: 754 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 503 / 1066
Version history: 7 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)