Mercurial > hg > Database > jungle-network
comparison src/alice/jungle/transaction/NetworkDefaultJungleTreeEditor.java @ 92:e95faa202b4f
Modified NetworkDefaultJungleTreeEditor class. Removed uuid and serverUpdater fields
author | one |
---|---|
date | Mon, 11 Nov 2013 19:35:22 +0900 |
parents | 2c7b3f2b2ee1 |
children | 75cf01a430a6 |
comparison
equal
deleted
inserted
replaced
91:2c7b3f2b2ee1 | 92:e95faa202b4f |
---|---|
28 | 28 |
29 public class NetworkDefaultJungleTreeEditor<T extends TreeNode<T>> implements JungleTreeEditor { | 29 public class NetworkDefaultJungleTreeEditor<T extends TreeNode<T>> implements JungleTreeEditor { |
30 | 30 |
31 private final TransactionManager<T> txManager; | 31 private final TransactionManager<T> txManager; |
32 private final T root; | 32 private final T root; |
33 private final TreeEditor editor; | |
33 private final String treeName; | 34 private final String treeName; |
34 private final TreeEditor editor; | |
35 private final TreeOperationLog log; | 35 private final TreeOperationLog log; |
36 private final String uuid; | |
37 | 36 |
38 public NetworkDefaultJungleTreeEditor(String _uuid, String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor) | 37 public NetworkDefaultJungleTreeEditor(String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor) |
39 { | 38 { |
40 this(_uuid, _treeName, _root,_txManager,_editor,new DefaultTreeOperationLog()); | 39 this(_treeName, _root,_txManager,_editor,new DefaultTreeOperationLog()); |
41 } | 40 } |
42 | 41 |
43 public NetworkDefaultJungleTreeEditor(String _uuid, String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor, TreeOperationLog _log) | 42 public NetworkDefaultJungleTreeEditor(String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor, TreeOperationLog _log) |
44 { | 43 { |
45 uuid = _uuid; | |
46 treeName = _treeName; | 44 treeName = _treeName; |
47 root = _root; | 45 root = _root; |
48 txManager = _txManager; | 46 txManager = _txManager; |
49 editor = _editor; | 47 editor = _editor; |
50 log = _log; | 48 log = _log; |
70 | 68 |
71 Iterable<TreeOperation> iterable = new IterableConverter<TreeOperation,NodeOperation>(newLog,converter); | 69 Iterable<TreeOperation> iterable = new IterableConverter<TreeOperation,NodeOperation>(newLog,converter); |
72 DefaultTreeOperationLog treeOperationLog = new DefaultTreeOperationLog(iterable,newLog.length()); | 70 DefaultTreeOperationLog treeOperationLog = new DefaultTreeOperationLog(iterable,newLog.length()); |
73 TreeOperationLog newTreeOpLog = log.append(treeOperationLog); | 71 TreeOperationLog newTreeOpLog = log.append(treeOperationLog); |
74 | 72 |
75 JungleTreeEditor newEditor = new NetworkDefaultJungleTreeEditor<T>(uuid, treeName, newNode,txManager,editor,newTreeOpLog); | 73 JungleTreeEditor newEditor = new NetworkDefaultJungleTreeEditor<T>(treeName, newNode,txManager,editor,newTreeOpLog); |
76 return DefaultEither.newB(newEditor); | 74 return DefaultEither.newB(newEditor); |
77 } | 75 } |
78 | 76 |
79 @Override | 77 @Override |
80 public Either<Error,JungleTreeEditor> addNewChildAt(NodePath _path, int _pos) | 78 public Either<Error,JungleTreeEditor> addNewChildAt(NodePath _path, int _pos) |
117 if(either.isA()){ | 115 if(either.isA()){ |
118 return DefaultEither.newA(either.a()); | 116 return DefaultEither.newA(either.a()); |
119 } | 117 } |
120 | 118 |
121 TransactionManager<T> newTxManager = either.b(); | 119 TransactionManager<T> newTxManager = either.b(); |
122 JungleTreeEditor newTreeEditor = new NetworkDefaultJungleTreeEditor<T>(uuid, treeName, root,newTxManager,editor); | 120 JungleTreeEditor newTreeEditor = new NetworkDefaultJungleTreeEditor<T>(treeName, root,newTxManager,editor); |
123 | 121 |
124 return DefaultEither.newB(newTreeEditor); | 122 return DefaultEither.newB(newTreeEditor); |
125 } | 123 } |
126 | 124 |
127 @Override | 125 @Override |
140 public Node getRoot() | 138 public Node getRoot() |
141 { | 139 { |
142 return root.getAsNode(); | 140 return root.getAsNode(); |
143 } | 141 } |
144 | 142 |
145 public TreeOperationLog getTreeOperationLog() { | |
146 return log; | |
147 } | |
148 | |
149 public String getTreeName() { | 143 public String getTreeName() { |
150 return treeName; | 144 return treeName; |
151 } | 145 } |
152 | 146 |
153 public String getUpdaterName() { | 147 public TreeOperationLog getTreeOperationLog() { |
154 return uuid; | 148 return log; |
155 } | 149 } |
156 | |
157 } | 150 } |