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

22
LINES

< > BotCompany Repo | #1035458 // G22NetworkInstance - an instance of a G22Network ready for use in calculation (backup)

JavaX fragment (include)

1  
transient srecord noeq G22NetworkInstance(G22Network network) {
2  
  new Map<S, O> elementsByIdentifier;
3  
  new Map<G22NetworkElement, O> elementsByBlueprint;
4  
  
5  
  void makeInstance(G22Utils g22utils, G22NetworkElement e) {
6  
    if (e == null) ret;
7  
    
8  
    O instance = e.makeInstance(g22utils, this);
9  
    print("Calculated: " + instance);
10  
    
11  
    if (instance != null) {
12  
      elementsByBlueprint.put(e, instance);
13  
      mapPut(elementsByIdentifier, e.identifier(), instance);
14  
    }
15  
  }
16  
  
17  
  void init(G22Utils g22utils) {
18  
    // This is in wrong order anyway
19  
    for (e : network.elements)
20  
      makeInstance(g22utils, e);
21  
  }
22  
}

Author comment

Began life as a copy of #1035446

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035458
Snippet name: G22NetworkInstance - an instance of a G22Network ready for use in calculation (backup)
Eternal ID of this version: #1035458/1
Text MD5: ce73291a209cf82f94ba61b58e1ba36a
Author: stefan
Category: javax / gazelle 2
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-19 18:54:08
Source code size: 648 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 56 / 60
Referenced in: [show references]