comparison src/alice/jungle/operations/NetworkNodeOperation.java @ 77:2dba7e1cf9fa

Added NetworknodeOperation and Test
author one
date Tue, 15 Oct 2013 16:01:11 +0900
parents
children 0055d917c796
comparison
equal deleted inserted replaced
76:9e3198bf9547 77:2dba7e1cf9fa
1 package alice.jungle.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.operations.NodeOperation;
7
8 import org.msgpack.annotation.Message;
9
10
11 @Message
12 public class NetworkNodeOperation {
13
14 public int pos;
15 public String key = null;
16 public ByteBuffer value = null;
17 public Command command = null;
18
19 public NetworkNodeOperation() {
20 pos = -2;
21 }
22
23 public NetworkNodeOperation(NodeOperation _op) {
24 pos = _op.getPosition();
25 key = _op.getKey();
26 value = _op.getValue();
27 command= _op.getCommand();
28
29 }
30
31 public NetworkNodeOperation(int _pos, Command _command) {
32 pos = _pos;
33 command = _command;
34 }
35
36 public NetworkNodeOperation(String _key, Command _command) {
37 key = _key;
38 command = _command;
39 }
40
41 public NetworkNodeOperation(String _key, ByteBuffer _value, Command _command) {
42 key = _key;
43 value = _value;
44 command = _command;
45 }
46
47 public NetworkNodeOperation(Command _command) {
48 command = _command;
49 }
50
51 public int getPosition() {
52 return pos;
53 }
54
55 public String getKey() {
56 return key;
57 }
58
59 public ByteBuffer getValue() {
60 return value;
61 }
62
63 public Command getCommand() {
64 return command;
65 }
66 }