Mercurial > hg > Members > nobuyasu > jungle-network
changeset 6:02bdf23edf5a
modifie DefaultTreeOperationCotnainer
author | one |
---|---|
date | Tue, 11 Jun 2013 05:32:46 +0900 |
parents | 8f4fe96dc8e4 |
children | b7396f848d78 |
files | src/jungle/test/datasegment/store/operations/DefaultNodePathContainer.java src/jungle/test/datasegment/store/operations/DefaultTreeOperationContainer.java |
diffstat | 2 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jungle/test/datasegment/store/operations/DefaultNodePathContainer.java Mon Jun 10 18:31:52 2013 +0900 +++ b/src/jungle/test/datasegment/store/operations/DefaultNodePathContainer.java Tue Jun 11 05:32:46 2013 +0900 @@ -33,7 +33,7 @@ } - public void unconvert(DefaultNodePath path) throws IOException { + public void unconvert(NodePath path) throws IOException { MessagePack msgpack = new MessagePack(); List<Integer> list = new LinkedList<Integer>(); for(Integer i : path) {
--- a/src/jungle/test/datasegment/store/operations/DefaultTreeOperationContainer.java Mon Jun 10 18:31:52 2013 +0900 +++ b/src/jungle/test/datasegment/store/operations/DefaultTreeOperationContainer.java Tue Jun 11 05:32:46 2013 +0900 @@ -25,16 +25,14 @@ String key = "hoge"; ByteBuffer b = ByteBuffer.wrap("messagepack value".getBytes()); PutAttributeOperation op = new PutAttributeOperation(key, b); - DefaultNodeOperationContainer opContainer = new DefaultNodeOperationContainer(); - opContainer.unconvert(op); DefaultNodePath p = new DefaultNodePath(); p = p.add(1).add(2).add(3); - DefaultNodePathContainer pathContainer = new DefaultNodePathContainer(); - pathContainer.unconvert(p); + DefaultTreeOperation treeOp = new DefaultTreeOperation(p, op); + + DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); + treeOperationContainer.unconvert(treeOp); - DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); - treeOperationContainer.unconvert(opContainer, pathContainer); TreeOperation treeOperation = treeOperationContainer.convert(); NodePath nodePath = treeOperation.getNodePath(); NodeOperation nodeOp = treeOperation.getNodeOperation(); @@ -70,6 +68,16 @@ public DefaultTreeOperationContainer() { } + + public void unconvert(DefaultTreeOperation _op) throws IOException { + NodeOperation nodeOp = _op.getNodeOperation(); + NodePath nodePath = _op.getNodePath(); + DefaultNodeOperationContainer opContainer = new DefaultNodeOperationContainer(); + opContainer.unconvert(nodeOp); + DefaultNodePathContainer pathContainer = new DefaultNodePathContainer(); + pathContainer.unconvert(nodePath); + unconvert(opContainer, pathContainer); + } public void unconvert(DefaultNodeOperationContainer _op, DefaultNodePathContainer _path) throws IOException {