Mercurial > hg > Database > jungle-network
comparison src/jungle/test/datasegment/store/operations/DefaultTreeOperationLogContainer.java @ 9:49c0eaa4dce2
add StartCodeSegment.java
author | one |
---|---|
date | Tue, 11 Jun 2013 14:09:42 +0900 |
parents | ee93e16d5a3f |
children | e968224ad0ce |
comparison
equal
deleted
inserted
replaced
8:ee93e16d5a3f | 9:49c0eaa4dce2 |
---|---|
39 list.add(op); | 39 list.add(op); |
40 DefaultTreeOperationLog log = new DefaultTreeOperationLog(list, list.size()); | 40 DefaultTreeOperationLog log = new DefaultTreeOperationLog(list, list.size()); |
41 | 41 |
42 DefaultTreeOperationLogContainer logContainer = new DefaultTreeOperationLogContainer(); | 42 DefaultTreeOperationLogContainer logContainer = new DefaultTreeOperationLogContainer(); |
43 logContainer.unconvert(log); | 43 logContainer.unconvert(log); |
44 | |
45 MessagePack msgpack = new MessagePack(); | |
46 Value logContainerValue = msgpack.unconvert(logContainer); | |
47 DefaultTreeOperationLogContainer convertedLogContainer = msgpack.convert(logContainerValue, | |
48 DefaultTreeOperationLogContainer.class); | |
44 | 49 |
45 TreeOperationLog convertedLog = logContainer.convert(); | 50 TreeOperationLog convertedLog = convertedLogContainer.convert(); |
46 for (TreeOperation treeOp : convertedLog) { | 51 for (TreeOperation treeOp : convertedLog) { |
47 NodePath path = treeOp.getNodePath(); | 52 NodePath path = treeOp.getNodePath(); |
48 NodeOperation nodeOp = treeOp.getNodeOperation(); | 53 NodeOperation nodeOp = treeOp.getNodeOperation(); |
49 Command c = nodeOp.getCommand(); | 54 Command c = nodeOp.getCommand(); |
50 String str = ""; | 55 String str = ""; |
67 break; | 72 break; |
68 case DELETE_CHILD: | 73 case DELETE_CHILD: |
69 str = String.format("pos:%d", nodeOp.getPosition()); | 74 str = String.format("pos:%d", nodeOp.getPosition()); |
70 break; | 75 break; |
71 } | 76 } |
72 System.out.println(String.format("[%s:%s:%s]", c, nodePath, str)); | 77 System.out.println(String.format("[%s:%s:%s]", c, path, str)); |
73 for (int i: nodePath ) { | 78 for (int i: path ) { |
74 System.out.println(i); | 79 System.out.println(i); |
75 } | 80 } |
76 | 81 |
77 } | 82 } |
78 | 83 |