annotate src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/PutAttributeOperation.java @ 146:371b6ddb78f2

repair putAttributeIndex and deleteAttributeIndex
author one
date Fri, 21 Nov 2014 12:46:06 +0900
parents bd82c20a6da0
children
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
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
3 import java.nio.ByteBuffer;
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
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
16
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
10
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
11 public class PutAttributeOperation implements NodeOperation
16
35c661de095d added Parameter ... etc..
Shoshi TAMAKI
parents:
diff changeset
12 {
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
13 private final String key;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
14 private final ByteBuffer value;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
15
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
16 public PutAttributeOperation(String _key,ByteBuffer _value)
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
17 {
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
18 key = _key;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
19 value = _value;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
20 }
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
21
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
22 @Override
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
23 public Command getCommand()
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
24 {
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
25 return Command.PUT_ATTRIBUTE;
18
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
26 }
8d4cbd5a6525 added Operation
Shoshi TAMAKI
parents: 16
diff changeset
27
92
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
28 @Override
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
29 public Either<Error,TreeNode> invoke(TreeNode _target)
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
30 {
92
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
31 return _target.getAttributes().put(key,value);
14ce7a0dedca Logging Node and Editor
one
parents: 81
diff changeset
32 }
55
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
33 @Override
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
34 public int getPosition()
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
35 {
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
36 return -1;
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
37 }
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
38
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
39 @Override
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
40 public String getKey()
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
41 {
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
42 return key;
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
43 }
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
44
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
45 @Override
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
46 public ByteBuffer getValue()
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
47 {
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
48 return value;
4ff16d970ffc added getter to operations
Shoshi TAMAKI
parents: 50
diff changeset
49 }
33
9f8b91265c3e added NullJournal
Shoshi TAMAKI
parents: 19
diff changeset
50 }