annotate src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/DeleteChildAtOperation.java @ 52:8c6ff361b68a

sleepy
author Shoshi TAMAKI
date Fri, 08 Feb 2013 03:50:21 +0900
parents 0a3bff2d9c89
children 4ff16d970ffc
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
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
3 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
4 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteChildAt;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableNode;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
8
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
9 public class DeleteChildAtOperation implements NodeOperation
16
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
10 {
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
11 private final int pos;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
12
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
13 public DeleteChildAtOperation(int _pos)
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
14 {
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
15 pos = _pos;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
16 }
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
17
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
18 @Override
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
19 public Command getCommand()
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
20 {
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
21 return Command.DELETE_CHILD;
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
22 }
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
23
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
24 @Override
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
25 public <T extends EditableNode<T>> Either<Error, T> invoke(T _target)
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
26 {
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
27 DeleteChildAt deleteChildAt = new DeleteChildAt(pos);
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
28 return deleteChildAt.edit(_target);
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 19
diff changeset
29 }
16
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
30 }