Mercurial > hg > Database > jungle-sharp
view Main/jungle-main/store/transformer/DeleteChildAt.cs @ 35:f2ea780b3e80
fix
author | Kazuma Takeda |
---|---|
date | Wed, 22 Feb 2017 16:30:19 +0900 |
parents | 1f99e150f336 |
children |
line wrap: on
line source
using System.Collections; namespace JungleDB { public class DeleteChildAt : NodeEditor { private int pos; public DeleteChildAt(int _pos) { pos = _pos; } public Either<Error, LoggingNode> _edit(LoggingNode logNode) { Either<Error,LoggingNode> either = logNode.getChildren().deleteChildAt(pos); if(either.isA()){ // error return either; } return DefaultEither<Error, LoggingNode>.newB(either.b()); } public Either<Error, LoggingNode> edit(TreeNode _e) { LoggingNode logNode = wrap(_e); return _edit(logNode); } public LoggingNode wrap(TreeNode node) { return new LoggingNode(node); } public LoggingNode wrap(TreeNode node, OperationLog op) { return new LoggingNode(node, op); } } }