annotate src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/PutAttributeOperation.java @ 50:0a3bff2d9c89

modified operation things
author Shoshi TAMAKI
date Fri, 08 Feb 2013 01:51:04 +0900
parents src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/operations/SetAttributeOperation.java@9f8b91265c3e
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
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;
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableNode;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.PutAttribute;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
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
50
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
28 @Override
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
29 public <T extends EditableNode<T>> Either<Error, T> invoke(T _target)
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
30 {
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
31 PutAttribute putAttribute = new PutAttribute(key,value);
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
32 return putAttribute.edit(_target);
0a3bff2d9c89 modified operation things
Shoshi TAMAKI
parents: 33
diff changeset
33 }
33
9f8b91265c3e added NullJournal
Shoshi TAMAKI
parents: 19
diff changeset
34 }