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;
|
92
|
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
|
|
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
|
|
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
|
81
|
9
|
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
|
92
|
25 @Override
|
|
26 public Either<Error,TreeNode> invoke(TreeNode _target)
|
50
|
27 {
|
92
|
28 return _target.getChildren().addNewChildAt(pos);
|
|
29 }
|
55
|
30
|
|
31 @Override
|
|
32 public int getPosition()
|
|
33 {
|
|
34 return pos;
|
|
35 }
|
|
36
|
|
37 @Override
|
|
38 public String getKey()
|
|
39 {
|
|
40 return null;
|
|
41 }
|
|
42
|
|
43 @Override
|
|
44 public ByteBuffer getValue()
|
|
45 {
|
|
46 return null;
|
|
47 }
|
16
|
48 }
|