Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 327:6492bab8f00d
fix filename again
author | kono |
---|---|
date | Sat, 08 Jul 2017 20:26:07 +0900 |
parents | 094959969033 |
children | 2de41738dc3b |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/ReplaceRootNodeAt.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/replaceRootNodeAt.java |
diffstat | 2 files changed, 40 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/ReplaceRootNodeAt.java Sat Jul 08 20:26:07 2017 +0900 @@ -0,0 +1,40 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer; + +import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; +import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error.Error; + +public class ReplaceRootNodeAt implements NodeEditor { + + + public Either<Error, LoggingNode> _edit(LoggingNode _e) + { + Either<Error,LoggingNode> either = _e.replaceNewRootNode(); + if(either.isA()){ + // error + return either; + } + return DefaultEither.newB(either.b()); + } + + + @Override + public Either<Error, LoggingNode> edit(TreeNode _e) { + LoggingNode logNode = wrap(_e); + return _edit(logNode); + } + + public LoggingNode wrap(TreeNode node) { + return new LoggingNode(node); + } + + + @Override + public LoggingNode wrap(TreeNode newRoot, TreeNode editedNode, OperationLog operationLog) { + return new LoggingNode(newRoot,editedNode, operationLog); + } + +}
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/replaceRootNodeAt.java Sat Jul 08 20:19:02 2017 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer; - -import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Error.Error; - -public class ReplaceRootNodeAt implements NodeEditor { - - - public Either<Error, LoggingNode> _edit(LoggingNode _e) - { - Either<Error,LoggingNode> either = _e.replaceNewRootNode(); - if(either.isA()){ - // error - return either; - } - return DefaultEither.newB(either.b()); - } - - - @Override - public Either<Error, LoggingNode> edit(TreeNode _e) { - LoggingNode logNode = wrap(_e); - return _edit(logNode); - } - - public LoggingNode wrap(TreeNode node) { - return new LoggingNode(node); - } - - - @Override - public LoggingNode wrap(TreeNode newRoot, TreeNode editedNode, OperationLog operationLog) { - return new LoggingNode(newRoot,editedNode, operationLog); - } - -}