changeset 93:ef68358ed0e8

Merge with 7058e85875a59d1951cc5eeaa049e4788ea96deb
author one
date Sat, 06 Sep 2014 10:18:47 +0900
parents 14ce7a0dedca (current diff) 7058e85875a5 (diff)
children 328faf4b37c5
files src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultTreeEditor.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/logger/LoggingNodeHook.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/AppendChildAt.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/DeleteAttribute.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/DeleteChildAt.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/NodeEditor.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/PutAttribute.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultJungleTreeEditor.java
diffstat 7 files changed, 140 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/document/JungleMindmap.mm	Sat Sep 06 05:03:10 2014 +0900
+++ b/document/JungleMindmap.mm	Sat Sep 06 10:18:47 2014 +0900
@@ -1,6 +1,17 @@
 <map version="1.0.1">
 <!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
-<node CREATED="1409726078288" ID="ID_647478089" MODIFIED="1409726241496" TEXT="New Mindmap">
+<node CREATED="1409726078288" ID="ID_647478089" MODIFIED="1409912802514">
+<richcontent TYPE="NODE"><html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      Jungle
+    </p>
+  </body>
+</html>
+</richcontent>
 <node CREATED="1409726154557" ID="ID_751550789" MODIFIED="1409726198467" POSITION="right" TEXT="&#x30b9;&#x30b1;&#x30b8;&#x30e5;&#x30fc;&#x30eb;">
 <node CREATED="1409726169906" HGAP="21" ID="ID_1745036704" MODIFIED="1409726235708" TEXT="9/15&#x6c38;&#x5c71;&#x3055;&#x3093;&#x6765;&#x6c96;" VSHIFT="-5"/>
 <node CREATED="1409726198468" HGAP="21" ID="ID_41465836" MODIFIED="1409726228823" TEXT="9/18PCI&#x30d7;&#x30ec;&#x30bc;&#x30f3;&#x30c6;&#x30fc;&#x30e7;&#x30f3;" VSHIFT="6"/>
@@ -18,20 +29,80 @@
 <node CREATED="1409726480115" ID="ID_1560015410" MODIFIED="1409726505822" TEXT="&#x306a;&#x306e;&#x3067;Jungle&#x3092;AVL&#x306b;"/>
 <node CREATED="1409726517683" ID="ID_1128117081" MODIFIED="1409726532614" TEXT="&#x66f4;&#x65b0;&#x3092;atomic&#x306b;&#x3057;&#x306a;&#x304f;&#x3066;&#x5927;&#x4e08;&#x592b;&#x304b;&#xff1f;"/>
 </node>
+<node CREATED="1409906422242" ID="ID_92678336" MODIFIED="1409907291863" TEXT="Log&#x3092;&#x53d6;&#x308b;&#x30ce;&#x30fc;&#x30c9;&#x3068;&#x53d6;&#x3089;&#x306a;&#x3044;Node&#x3092;&#x5206;&#x3051;&#x308b;" VSHIFT="81">
+<node CREATED="1409907299090" ID="ID_156102389" MODIFIED="1409907325388" TEXT="Logging&#x3092;&#x3059;&#x308b;Editor"/>
+<node CREATED="1409907325760" ID="ID_1693431989" MODIFIED="1409907338580" TEXT="Index&#x3092;&#x66f4;&#x65b0;&#x3059;&#x308b;Editor"/>
+<node CREATED="1409907339120" ID="ID_1167306471" MODIFIED="1409907353179" TEXT="Node&#x3092;&#x66f4;&#x65b0;&#x3059;&#x308b;&#x3060;&#x3051;&#x306e;Editor"/>
 </node>
-<node CREATED="1409726560355" HGAP="80" ID="ID_1680643421" MODIFIED="1409727171007" TEXT="Alice&#x306e;&#x90e8;&#x5206;&#x3067;IO&#x3068;&#x306f;&#x5225;&#x306b;&#x3057;&#x3066;&#x512a;&#x5148;&#x5ea6;&#x3092;&#x4e0a;&#x3052;&#x308b;" VSHIFT="8">
-<node CREATED="1409726580851" ID="ID_70332820" MODIFIED="1409726587062" TEXT="&#x30ed;&#x30b0;&#x306e;&#x66f8;&#x304d;&#x51fa;&#x3057;&#x3082;"/>
+</node>
+<node CREATED="1409726560355" HGAP="32" ID="ID_1680643421" MODIFIED="1409906495696" TEXT="Alice&#x306e;&#x90e8;&#x5206;&#x3067;IO&#x3068;&#x306f;&#x5225;&#x306b;&#x3057;&#x3066;&#x512a;&#x5148;&#x5ea6;&#x3092;&#x4e0a;&#x3052;&#x308b;" VSHIFT="13">
+<node CREATED="1409726580851" ID="ID_70332820" MODIFIED="1409906498998" TEXT="&#x30ed;&#x30b0;&#x306e;&#x66f8;&#x304d;&#x51fa;&#x3057;&#x3082;" VSHIFT="2"/>
 </node>
 <node CREATED="1409726600088" ID="ID_142965815" MODIFIED="1409727174343" TEXT="API" VSHIFT="18">
 <node CREATED="1409726606857" ID="ID_405344625" MODIFIED="1409726622494" TEXT="&#x57fa;&#x672c;&#x7684;&#x306b;&#x30d1;&#x30b9;&#x3067;&#x3057;&#x304b;&#x30a2;&#x30af;&#x30bb;&#x30b9;&#x3067;&#x304d;&#x306a;&#x3044;&#x306e;&#x3067;"/>
 <node CREATED="1409726624219" ID="ID_1368915826" MODIFIED="1409726642662" TEXT="index&#x3067;&#x30a2;&#x30af;&#x30bb;&#x30b9;&#x3067;&#x304d;&#x308b;&#x3088;&#x3046;&#x306b;&#x3057;&#x305f;&#x3044;">
-<node CREATED="1409726651188" ID="ID_763950066" MODIFIED="1409726663822" TEXT="Index&#x306e;&#x518d;&#x69cb;&#x6210;&#x304c;&#x6b32;&#x3057;&#x3044;"/>
+<node CREATED="1409726651188" ID="ID_763950066" MODIFIED="1409906505790" TEXT="Index&#x306e;&#x518d;&#x69cb;&#x6210;&#x304c;&#x6b32;&#x3057;&#x3044;" VSHIFT="2"/>
 </node>
 <node CREATED="1409726637570" ID="ID_1840769401" MODIFIED="1409726854710" TEXT="WEB&#x304b;&#x3089;&#x30a2;&#x30af;&#x30bb;&#x30b9;&#x3059;&#x308b;API&#x304c;&#x6b32;&#x3057;&#x3044;"/>
 <node CREATED="1409726842808" ID="ID_823399931" MODIFIED="1409726997548" TEXT="Key&#x3092;Forget&#x3059;&#x308b;API">
 <node CREATED="1409726998097" ID="ID_1404724140" MODIFIED="1409727013630" TEXT=" merge&#x3059;&#x308b;&#x53ef;&#x80fd;&#x6027;&#x304c;&#x3042;&#x308b;Key&#x3060;&#x3051;&#x6b8b;&#x3059;"/>
 </node>
 <node CREATED="1409726799739" ID="ID_1771872050" MODIFIED="1409727205486" TEXT="&#x30a2;&#x30af;&#x30bb;&#x30b9;&#x3057;&#x305f;&#x3068;&#x304d;&#x306b;&#x90e8;&#x5206;&#x7684;&#x306b;&#x53d6;&#x3063;&#x3066;&#x304f;&#x308b;API&#x3068;&#x90e8;&#x5206;&#x7684;&#x306b;&#x53d6;&#x3063;&#x3066;&#x304f;&#x308b;API&#x304c;&#x6b32;&#x3057;&#x3044;"/>
+<node CREATED="1409908104921" ID="ID_515208912" MODIFIED="1409912737202" TEXT="&#x691c;&#x7d22;&#x306e;API">
+<node CREATED="1409908119601" ID="ID_308661535" MODIFIED="1409908142364" TEXT="getTraversaer"/>
+<node CREATED="1409908143057" ID="ID_767737454" MODIFIED="1409912827805" TEXT="interface traverser">
+<node CREATED="1409912059464" ID="ID_1786348845" MODIFIED="1409912122574" TEXT="Attribute,name&#x306e;&#x5024;&#x304c;&quot;kanagawa&quot;&#x3067;&#x3042;&#x308b;&#x3082;&#x306e;&#x3092;&#x63a2;&#x3059;"/>
+<node CREATED="1409912127515" ID="ID_1936001294" MODIFIED="1409912138492" TEXT="count">
+<node CREATED="1409912143369" ID="ID_1101250261" MODIFIED="1409912287350" TEXT="List&#x304c;iterator&#x304c;&#x8fd4;&#x3063;&#x3066;&#x304f;&#x308b;" VSHIFT="2"/>
+</node>
+<node CREATED="1409912195387" ID="ID_1677264420" MODIFIED="1409912237384">
+<richcontent TYPE="NODE"><html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      oderBy
+    </p>
+  </body>
+</html>
+</richcontent>
+<node CREATED="1409912215937" ID="ID_591908705" MODIFIED="1409912282134" TEXT="" VSHIFT="2"/>
+</node>
+<node CREATED="1409912254809" ID="ID_1535341119" MODIFIED="1409912270524" TEXT="distinct"/>
+<node CREATED="1409912297489" ID="ID_185517541" MODIFIED="1409912300012" TEXT="sum"/>
+<node CREATED="1409912303321" ID="ID_1425057782" MODIFIED="1409912312172" TEXT="&#x8907;&#x6570;&#x306e;Tree&#x306e;Traverse">
+<node CREATED="1409912382240" ID="ID_1596998457" MODIFIED="1409912894126" TEXT="&#x8907;&#x6570;&#x306e;Tree&#x304b;&#x3089;Attribute,&quot;name&quot;&#x306e;&#x5024;&#x304c;&#x7b49;&#x3057;&#x3044;&#x3082;&#x306e;&#x306e;&#x30ea;&#x30b9;&#x30c8;&#x3092;&#x6301;&#x3063;&#x3066;&#x304f;&#x308b;&#x30d7;&#x30ed;&#x30b0;&#x30e9;&#x30e0;&#x3092;&#x4f5c;&#x3063;&#x3066;&#x304f;&#x308b;(&#x5bbf;&#x984c;)" VSHIFT="1"/>
+</node>
+</node>
+<node CREATED="1409912823732" ID="ID_68210354" MODIFIED="1409912881846" TEXT="interfaceTraverser&#x304b;&#x3089;Index&#x304c;&#x5fc5;&#x8981;&#x306a;Attribute&#x3092;&#x53d6;&#x308a;&#x51fa;&#x3059;(&#x5bbf;&#x984c;)"/>
+<node CREATED="1409908160464" ID="ID_541009496" MODIFIED="1409908289626">
+<richcontent TYPE="NODE"><html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      output
+    </p>
+  </body>
+</html>
+</richcontent>
+<node CREATED="1409908164657" ID="ID_994155079" MODIFIED="1409910871356" TEXT="Node&#x3068;Path&#x306e;&#x30ea;&#x30b9;&#x30c8;&#x306e;iterater" VSHIFT="2"/>
+</node>
+<node CREATED="1409912737817" ID="ID_1598031941" MODIFIED="1409912768605" TEXT="index&#x3092;&#x524a;&#x9664;&#x3059;&#x308b;API" VSHIFT="26"/>
+</node>
+<node CREATED="1409913383955" ID="ID_653968339" MODIFIED="1409913399484" TEXT="&#x8ab0;&#x304c;&#x691c;&#x7d22;&#x3057;&#x305f;&#x304b;&#x3092;&#x4fdd;&#x5b58;&#x3059;&#x308b;API"/>
+</node>
+<node CREATED="1409906099431" HGAP="22" ID="ID_1697852268" MODIFIED="1409906130605" TEXT="index&#x3092;&#x3064;&#x3051;&#x308b;" VSHIFT="50">
+<node CREATED="1409906161185" HGAP="18" ID="ID_37822884" MODIFIED="1409912675141" TEXT="Key&#x3068;Node&#x306e;HashMap&#x3068;Attribute&quot;name&quot;&#x306e;HashMap&#x3092;&#x767b;&#x9332;&#x3059;&#x308b;" VSHIFT="-10"/>
+<node CREATED="1409906200281" HGAP="21" ID="ID_957989771" MODIFIED="1409906786182" TEXT="&#x5404;version&#x6bce;&#x306b;inde&#x304c;&#x3042;&#x308b;" VSHIFT="-14"/>
+<node CREATED="1409906235377" HGAP="18" ID="ID_1286646129" MODIFIED="1409906798789" TEXT="index&#x306f;fj&#x306e;TreeHashMap&#x3092;&#x4f7f;&#x3046;" VSHIFT="-3">
+<node CREATED="1409912676387" ID="ID_1944162611" MODIFIED="1409912716086" TEXT="&#x975e;&#x7834;&#x58ca;&#x306e;index&#x3092;&#x4f7f;&#x3044;&#x305f;&#x3044;"/>
+</node>
+<node CREATED="1409906326546" HGAP="22" ID="ID_1269584258" MODIFIED="1409906815222" TEXT="index&#x306f;attribute&#x3068;Node&#x306e;&#x4e8c;&#x3064;&#x3092;&#x7528;&#x610f;&#x3059;&#x308b;" VSHIFT="-5"/>
+<node CREATED="1409906387306" HGAP="22" ID="ID_63715775" MODIFIED="1409906810134" TEXT="index&#x3092;&#x5171;&#x6709;&#x3059;&#x308b;&#x3068;&#x3044;&#x3044;" VSHIFT="-6"/>
+<node CREATED="1409906610393" HGAP="19" ID="ID_29204462" MODIFIED="1409906820222" TEXT="index&#x304c;AVLTree&#x306a;&#x306e;&#x3067;Jungle&#x306f;AVLTree&#x306b;&#x3057;&#x306a;&#x304f;&#x3066;&#x3044;&#x3044;"/>
 </node>
 </node>
 <node CREATED="1409726668370" ID="ID_204371770" MODIFIED="1409726690172" POSITION="right" TEXT="Matrix">
@@ -42,7 +113,7 @@
 <node CREATED="1409726724451" ID="ID_744658833" MODIFIED="1409726734998" TEXT="&#x30aa;&#x30da;&#x30ec;&#x30fc;&#x30b7;&#x30e7;&#x30f3;&#x3092;Jungle&#x304c;&#x3061;&#x3083;&#x3093;&#x3068;&#x30b5;&#x30dd;&#x30fc;&#x30c8;&#x3057;&#x3066;&#x3044;&#x308b;&#x304b;"/>
 </node>
 </node>
-<node CREATED="1409726752851" ID="ID_1096797544" MODIFIED="1409726764446" POSITION="left" TEXT="&#x30a2;&#x30b7;&#x30e5;&#x30a2;&#x30ce;&#x30fc;&#x30c8;">
+<node CREATED="1409726752851" HGAP="28" ID="ID_1096797544" MODIFIED="1409907420179" POSITION="left" TEXT="AssureNode" VSHIFT="43">
 <node CREATED="1409726765475" ID="ID_1507920801" MODIFIED="1409726773734" TEXT="Jungle&#x3068;&#x3064;&#x306a;&#x3052;&#x308b;"/>
 <node CREATED="1409726774355" ID="ID_105345677" MODIFIED="1409726796814" TEXT="&#x7de8;&#x96c6;&#x30b3;&#x30de;&#x30f3;&#x30c9;&#x3092;jungle&#x306b;&#x7ffb;&#x8a33;&#x3059;&#x308b;"/>
 </node>
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultAttributes.java	Sat Sep 06 05:03:10 2014 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultAttributes.java	Sat Sep 06 10:18:47 2014 +0900
@@ -1,4 +1,4 @@
-package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+/*package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
 
 import java.nio.ByteBuffer;
 
@@ -26,7 +26,6 @@
 		
 		return DefaultEither.newB(newNode);
 	}
-	*/
 	
 	public TreeMap<String,ByteBuffer> getAttributesAsRawMap()
 	{
@@ -50,5 +49,5 @@
 	{
 		return null;
 	}
-	*/
 }
+*/
\ No newline at end of file
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeNode.java	Sat Sep 06 05:03:10 2014 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeNode.java	Sat Sep 06 10:18:47 2014 +0900
@@ -1,6 +1,7 @@
 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
 
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.AttributesContainer;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.OperationLog;
 
 public interface TreeNode extends AttributesContainer
 {
@@ -10,6 +11,9 @@
 	public TreeNodeAttributes getAttributes();
 	
 	public TreeNode createNewNode();
-	//public Node getAsNode();
+	
+	public OperationLog getLog();
+	
+	public void putLog(OperationLog _log);
 	
 }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNode.java	Sat Sep 06 05:03:10 2014 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNode.java	Sat Sep 06 10:18:47 2014 +0900
@@ -6,25 +6,40 @@
 import fj.data.List;
 import fj.data.TreeMap;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.DefaultOperationLog;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.OperationLog;
 
 public class DefaultTreeNode implements TreeNode
 {
 	//private final DefaultNode wrap;
-	public List<TreeNode> children;
-	public TreeMap<String,ByteBuffer> attrs;
+	private List<TreeNode> children;
+	private TreeMap<String,ByteBuffer> attrs;
+	private OperationLog log;
 	
 	private static final List<TreeNode> NIL_LIST = List.nil();
 	private static final TreeMap<String,ByteBuffer> NIL_MAP = TreeMap.empty(Ord.stringOrd);
 	
 	public DefaultTreeNode()
 	{
-		this(NIL_LIST,NIL_MAP);
+		this(NIL_LIST,NIL_MAP,new DefaultOperationLog());
 	}
 	
 	public DefaultTreeNode(List<TreeNode> _children,TreeMap<String,ByteBuffer> _attrs)
 	{
+		this(_children, _attrs, new DefaultOperationLog());
+	}
+	
+	public DefaultTreeNode(TreeNode _node, OperationLog _log)
+	{
+		this(_node.getChildren().getChildrenAsRawList(), _node.getAttributes().getAttributesAsRawMap(), _log);
+	}
+	
+	
+	
+	public DefaultTreeNode(List<TreeNode> _children,TreeMap<String,ByteBuffer> _attrs, OperationLog _log){
 		attrs = _attrs;
 		children = _children;
+		log = _log;
 	}
 
 	@Override
@@ -36,7 +51,7 @@
 	@Override
 	public DefaultTreeNodeAttribute getAttributes()
 	{
-		return new DefaultTreeNodeAttribute(children, attrs);
+		return new DefaultTreeNodeAttribute(children, attrs,log);
 	}
 	
 	@Override
@@ -59,6 +74,17 @@
 	{
 		return new DefaultTreeNode(children,attrs);
 	}
+
+	@Override
+	public OperationLog getLog() {
+		OperationLog _log = log;
+		log = new DefaultOperationLog();
+		return _log;
+	}
 	
+	@Override
+	public void putLog(OperationLog _log){
+		log = _log;
+	}
 	
 }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeAttribute.java	Sat Sep 06 05:03:10 2014 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeAttribute.java	Sat Sep 06 10:18:47 2014 +0900
@@ -7,6 +7,10 @@
 import fj.data.TreeMap;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNodeAttributes;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.DefaultOperationLog;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.OperationLog;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.DeleteAttributeOperation;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.PutAttributeOperation;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.NodeEditorError;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
@@ -16,11 +20,20 @@
 {
 	public List<TreeNode> children;
 	public TreeMap<String,ByteBuffer> attrs;
+	OperationLog log ;
 	
 	public DefaultTreeNodeAttribute(List<TreeNode> _children,TreeMap<String,ByteBuffer> _attrs)
 	{
 		children = _children;
 		attrs = _attrs;
+		log = new DefaultOperationLog();
+	}
+	
+	public DefaultTreeNodeAttribute(List<TreeNode> _children,TreeMap<String,ByteBuffer> _attrs,OperationLog _log)
+	{
+		children = _children;
+		attrs = _attrs;
+		log = _log;
 	}
 
 	@Override
@@ -41,8 +54,8 @@
 		
 		TreeMap<String,ByteBuffer> newMap = attrs.delete(_key);
 		
-		TreeNode newNode = new DefaultTreeNode(children,newMap);
-		
+		OperationLog op = new DefaultOperationLog();;
+		TreeNode newNode = new DefaultTreeNode(children,newMap,op.add(new DeleteAttributeOperation(_key)));
 		return DefaultEither.newB(newNode);
 	}
 
@@ -58,8 +71,7 @@
 		
 		//TreeMap<String,ByteBuffer> raw = attrs.getAttributesAsRawMap();
 		TreeMap<String,ByteBuffer> newMap = attrs.set(_key,_value);
-		
-		TreeNode newNode = new DefaultTreeNode(children,newMap);
+		TreeNode newNode = new DefaultTreeNode(children,newMap,log.add(new PutAttributeOperation(_key,_value)));
 		
 		return DefaultEither.newB(newNode);
 	}
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeChildren.java	Sat Sep 06 05:03:10 2014 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeChildren.java	Sat Sep 06 10:18:47 2014 +0900
@@ -8,6 +8,11 @@
 import fj.data.TreeMap;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNodeChildren;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.DefaultOperationLog;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.OperationLog;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.AppendChildAtOperation;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.DeleteChildAtOperation;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.NodeEditorError;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
@@ -26,7 +31,7 @@
 	
 	public List<TreeNode> children;
 	public TreeMap<String,ByteBuffer> attrs;
-	
+
 	public DefaultTreeNodeChildren(List<TreeNode> _children,TreeMap<String,ByteBuffer> _attrs)
 	{
 		children = _children;
@@ -54,12 +59,11 @@
 			return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS);
 		}
 		
-		
-		
 		P2<List<TreeNode>,List<TreeNode>> split = children.splitAt(_pos);
 		List<TreeNode> newChildren = split._1().snoc(new DefaultTreeNode()).append(split._2());
-		TreeNode newNode = new DefaultTreeNode(newChildren,attrs);
-		
+		OperationLog op = new DefaultOperationLog();
+		TreeNode newNode = new DefaultTreeNode(newChildren,attrs,op.add(new AppendChildAtOperation(_pos)));
+
 		return DefaultEither.newB(newNode);
 	}
 
@@ -73,8 +77,8 @@
 		P2<List<TreeNode>,List<TreeNode>> split = children.splitAt(_pos);
 		List<TreeNode> newChildren = split._1().append(split._2().tail());
 		
-		
-		TreeNode newNode = new DefaultTreeNode(newChildren,attrs);
+		OperationLog op = new DefaultOperationLog();
+		TreeNode newNode = new DefaultTreeNode(newChildren,attrs,op.add(new DeleteChildAtOperation(_pos)));
 		
 		return DefaultEither.newB(newNode);
 	}
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/impl/node/DefaultAttributesTest.java	Sat Sep 06 05:03:10 2014 +0900
+++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/impl/node/DefaultAttributesTest.java	Sat Sep 06 10:18:47 2014 +0900
@@ -10,11 +10,9 @@
 import fj.data.Option;
 import fj.data.TreeMap;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.AttributesTest;
-import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultAttributes;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNodeAttributes;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeNode;
-import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeNodeAttribute;
 
 public class DefaultAttributesTest extends AttributesTest
 {