]> gerrit.simantics Code Review - simantics/platform.git/blob
5edea565fa56d00851d7d16582e09fa0fc59b651
[simantics/platform.git] /
1 package org.simantics.spreadsheet.graph.synchronization;
2
3 import java.io.Serializable;
4
5 import org.simantics.structural.synchronization.utils.ComponentBase;
6
7 import gnu.trove.map.hash.THashMap;
8 import gnu.trove.procedure.TObjectProcedure;
9
10 public class SheetLineComponent extends ComponentBase<SheetLineComponent> implements Serializable {
11
12     private static final long serialVersionUID = 1777515716175831266L;
13     
14         private THashMap<String, SheetLineComponent> childMap = new THashMap<>();
15         
16         public SheetLineComponent(String uid) {
17             super(uid, 0);
18         }
19         
20 //      public SheetLineComponent(String uid, String solverComponentName, int componentId) {
21 //              this.uid = uid;
22 //              this.solverComponentName = solverComponentName;
23 //              this.componentId = componentId;
24 //      }
25         
26         @Override
27         public THashMap<String, SheetLineComponent> getChildMap() {
28                 return childMap;
29         }
30
31         @Override
32         public void setChildMap(THashMap<String, SheetLineComponent> newChildMap) {
33                 childMap = newChildMap;
34                 if(childMap != null) {
35                         childMap.forEachValue(new TObjectProcedure<SheetLineComponent>() {
36                                 @Override
37                                 public boolean execute(SheetLineComponent component) {
38                                         component.parent = SheetLineComponent.this;
39                                         return true;
40                                 }
41                         });
42                 }
43         }
44         
45         @Override
46         public String toString() {
47             return solverComponentName + " (" + super.toString() + ")";
48         }
49
50 }