annotate src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/AppendChildAtOperation.java @ 92:14ce7a0dedca

Logging Node and Editor
author one
date Sat, 06 Sep 2014 05:03:10 +0900
parents 715a9fbf02fc
children bd82c20a6da0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
1 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations;
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
2
55
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
3 import java.nio.ByteBuffer;
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
4
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
92
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
81
715a9fbf02fc remove <T> many source
one
parents: 78
diff changeset
9
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
10
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
11 public final class AppendChildAtOperation implements NodeOperation
16
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
12 {
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
13 private final int pos;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
14
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
15 public AppendChildAtOperation(int _pos)
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
16 {
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
17 pos = _pos;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
18 }
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
19
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
20 public Command getCommand()
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
21 {
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
22 return Command.APPEND_CHILD;
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
23 }
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
24
92
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
25 @Override
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
26 public Either<Error,TreeNode> invoke(TreeNode _target)
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
27 {
92
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
28 return _target.getChildren().addNewChildAt(pos);
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
29 }
55
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
30
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
31 @Override
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
32 public int getPosition()
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
33 {
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
34 return pos;
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
35 }
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
36
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
37 @Override
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
38 public String getKey()
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
39 {
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
40 return null;
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
41 }
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
42
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
43 @Override
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
44 public ByteBuffer getValue()
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
45 {
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
46 return null;
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
47 }
16
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
48 }