16
|
1 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations;
|
|
2
|
55
|
3 import java.nio.ByteBuffer;
|
|
4
|
18
|
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
|
78
|
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
|
50
|
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteChildAt;
|
|
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
|
|
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
|
18
|
10
|
50
|
11 public class DeleteChildAtOperation implements NodeOperation
|
16
|
12 {
|
50
|
13 private final int pos;
|
|
14
|
|
15 public DeleteChildAtOperation(int _pos)
|
|
16 {
|
|
17 pos = _pos;
|
|
18 }
|
|
19
|
18
|
20 @Override
|
|
21 public Command getCommand()
|
|
22 {
|
|
23 return Command.DELETE_CHILD;
|
|
24 }
|
|
25
|
50
|
26 @Override
|
78
|
27 public <T extends TreeNode<T>> Either<Error,T> invoke(T _target)
|
50
|
28 {
|
|
29 DeleteChildAt deleteChildAt = new DeleteChildAt(pos);
|
|
30 return deleteChildAt.edit(_target);
|
|
31 }
|
55
|
32
|
|
33 @Override
|
|
34 public int getPosition()
|
|
35 {
|
|
36 return pos;
|
|
37 }
|
|
38
|
|
39 @Override
|
|
40 public String getKey()
|
|
41 {
|
|
42 return null;
|
|
43 }
|
|
44
|
|
45 @Override
|
|
46 public ByteBuffer getValue()
|
|
47 {
|
|
48 return null;
|
|
49 }
|
16
|
50 }
|