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.AppendChildAt;
|
|
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 final class AppendChildAtOperation implements NodeOperation
|
16
|
12 {
|
50
|
13 private final int pos;
|
|
14
|
|
15 public AppendChildAtOperation(int _pos)
|
|
16 {
|
|
17 pos = _pos;
|
|
18 }
|
|
19
|
18
|
20 public Command getCommand()
|
|
21 {
|
|
22 return Command.APPEND_CHILD;
|
|
23 }
|
|
24
|
50
|
25 @Override
|
78
|
26 public <T extends TreeNode<T>> Either<Error,T> invoke(T _target)
|
50
|
27 {
|
|
28 AppendChildAt appendChildAt = new AppendChildAt(pos);
|
|
29 return appendChildAt.edit(_target);
|
|
30 }
|
55
|
31
|
|
32 @Override
|
|
33 public int getPosition()
|
|
34 {
|
|
35 return pos;
|
|
36 }
|
|
37
|
|
38 @Override
|
|
39 public String getKey()
|
|
40 {
|
|
41 return null;
|
|
42 }
|
|
43
|
|
44 @Override
|
|
45 public ByteBuffer getValue()
|
|
46 {
|
|
47 return null;
|
|
48 }
|
16
|
49 }
|