comparison Main/jungle-main/transaction/DefaultJungleTreeEditor.cs @ 33:56de71ae6f7e

Implementation of fmap.
author Kazuma Takeda
date Sat, 28 Jan 2017 19:12:18 +0900
parents 1466993c104c
children a79781723862
comparison
equal deleted inserted replaced
32:07318c10b894 33:56de71ae6f7e
48 DefaultTreeOperationLog treeOperationLog = new DefaultTreeOperationLog (iterable, newLog.length ()); 48 DefaultTreeOperationLog treeOperationLog = new DefaultTreeOperationLog (iterable, newLog.length ());
49 TreeOperationLog newTreeOpLog = log.append (treeOperationLog); 49 TreeOperationLog newTreeOpLog = log.append (treeOperationLog);
50 50
51 JungleTreeEditor newEditor = new DefaultJungleTreeEditor (newNode, txManager, editor, newTreeOpLog); 51 JungleTreeEditor newEditor = new DefaultJungleTreeEditor (newNode, txManager, editor, newTreeOpLog);
52 newEditor.SetPrevPath (this.prevPath); 52 newEditor.SetPrevPath (this.prevPath);
53
53 return DefaultEither<Error, JungleTreeEditor>.newB (newEditor); 54 return DefaultEither<Error, JungleTreeEditor>.newB (newEditor);
54 55
55 } 56 }
56 57
57 58
72 } 73 }
73 74
74 75
75 public Either<Error, JungleTreeEditor> putAttribute(NodePath _path, string _key, object _value) { 76 public Either<Error, JungleTreeEditor> putAttribute(NodePath _path, string _key, object _value) {
76 PutAttribute putAttribute = new PutAttribute (_key, _value); 77 PutAttribute putAttribute = new PutAttribute (_key, _value);
78 return _edit (_path, putAttribute);
79 }
80
81 public Either<Error, JungleTreeEditor> putAttribute(NodePath _path, object _value) {
82 PutAttribute putAttribute = new PutAttribute (_value.ToString(), _value);
77 return _edit (_path, putAttribute); 83 return _edit (_path, putAttribute);
78 } 84 }
79 85
80 public Either<Error, JungleTreeEditor> putAttribute(string _key, object _value) { 86 public Either<Error, JungleTreeEditor> putAttribute(string _key, object _value) {
81 PutAttribute putAttribute = new PutAttribute (_key, _value); 87 PutAttribute putAttribute = new PutAttribute (_key, _value);