Mercurial > hg > Database > jungle-network
comparison src/jungle/test/datasegment/store/operations/DefaultTreeOperationContainer.java @ 6:02bdf23edf5a
modifie DefaultTreeOperationCotnainer
author | one |
---|---|
date | Tue, 11 Jun 2013 05:32:46 +0900 |
parents | 8f4fe96dc8e4 |
children |
comparison
equal
deleted
inserted
replaced
5:8f4fe96dc8e4 | 6:02bdf23edf5a |
---|---|
23 | 23 |
24 public static void main(String[] args) throws IOException { | 24 public static void main(String[] args) throws IOException { |
25 String key = "hoge"; | 25 String key = "hoge"; |
26 ByteBuffer b = ByteBuffer.wrap("messagepack value".getBytes()); | 26 ByteBuffer b = ByteBuffer.wrap("messagepack value".getBytes()); |
27 PutAttributeOperation op = new PutAttributeOperation(key, b); | 27 PutAttributeOperation op = new PutAttributeOperation(key, b); |
28 DefaultNodeOperationContainer opContainer = new DefaultNodeOperationContainer(); | |
29 opContainer.unconvert(op); | |
30 | 28 |
31 DefaultNodePath p = new DefaultNodePath(); | 29 DefaultNodePath p = new DefaultNodePath(); |
32 p = p.add(1).add(2).add(3); | 30 p = p.add(1).add(2).add(3); |
33 DefaultNodePathContainer pathContainer = new DefaultNodePathContainer(); | 31 DefaultTreeOperation treeOp = new DefaultTreeOperation(p, op); |
34 pathContainer.unconvert(p); | 32 |
33 DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); | |
34 treeOperationContainer.unconvert(treeOp); | |
35 | 35 |
36 DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); | |
37 treeOperationContainer.unconvert(opContainer, pathContainer); | |
38 TreeOperation treeOperation = treeOperationContainer.convert(); | 36 TreeOperation treeOperation = treeOperationContainer.convert(); |
39 NodePath nodePath = treeOperation.getNodePath(); | 37 NodePath nodePath = treeOperation.getNodePath(); |
40 NodeOperation nodeOp = treeOperation.getNodeOperation(); | 38 NodeOperation nodeOp = treeOperation.getNodeOperation(); |
41 Command c = nodeOp.getCommand(); | 39 Command c = nodeOp.getCommand(); |
42 String str = ""; | 40 String str = ""; |
68 } | 66 } |
69 | 67 |
70 public DefaultTreeOperationContainer() { | 68 public DefaultTreeOperationContainer() { |
71 | 69 |
72 } | 70 } |
71 | |
72 public void unconvert(DefaultTreeOperation _op) throws IOException { | |
73 NodeOperation nodeOp = _op.getNodeOperation(); | |
74 NodePath nodePath = _op.getNodePath(); | |
75 DefaultNodeOperationContainer opContainer = new DefaultNodeOperationContainer(); | |
76 opContainer.unconvert(nodeOp); | |
77 DefaultNodePathContainer pathContainer = new DefaultNodePathContainer(); | |
78 pathContainer.unconvert(nodePath); | |
79 unconvert(opContainer, pathContainer); | |
80 } | |
73 | 81 |
74 public void unconvert(DefaultNodeOperationContainer _op, | 82 public void unconvert(DefaultNodeOperationContainer _op, |
75 DefaultNodePathContainer _path) throws IOException { | 83 DefaultNodePathContainer _path) throws IOException { |
76 MessagePack msgpack = new MessagePack(); | 84 MessagePack msgpack = new MessagePack(); |
77 pathValue = msgpack.unconvert(_path); | 85 pathValue = msgpack.unconvert(_path); |