Mercurial > hg > Members > tatsuki > bench > jungle-core
comparison 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 |
comparison
equal
deleted
inserted
replaced
49:e3a507fd57a4 | 50:0a3bff2d9c89 |
---|---|
1 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations; | |
2 | |
3 import java.nio.ByteBuffer; | |
4 | |
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; | |
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableNode; | |
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.PutAttribute; | |
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; | |
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; | |
10 | |
11 public class PutAttributeOperation implements NodeOperation | |
12 { | |
13 private final String key; | |
14 private final ByteBuffer value; | |
15 | |
16 public PutAttributeOperation(String _key,ByteBuffer _value) | |
17 { | |
18 key = _key; | |
19 value = _value; | |
20 } | |
21 | |
22 @Override | |
23 public Command getCommand() | |
24 { | |
25 return Command.PUT_ATTRIBUTE; | |
26 } | |
27 | |
28 @Override | |
29 public <T extends EditableNode<T>> Either<Error, T> invoke(T _target) | |
30 { | |
31 PutAttribute putAttribute = new PutAttribute(key,value); | |
32 return putAttribute.edit(_target); | |
33 } | |
34 } |