annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
77
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
1 package alice.jungle.operations;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
2
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
3 import java.nio.ByteBuffer;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
4
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
7
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
8 import org.msgpack.annotation.Message;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
9
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
10
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
11 @Message
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
12 public class NetworkNodeOperation {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
13
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
14 public int pos;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
15 public String key = null;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
16 public ByteBuffer value = null;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
17 public Command command = null;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
18
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
19 public NetworkNodeOperation() {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
20 pos = -2;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
21 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
22
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
23 public NetworkNodeOperation(NodeOperation _op) {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
24 pos = _op.getPosition();
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
25 key = _op.getKey();
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
26 value = _op.getValue();
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
27 command= _op.getCommand();
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
28
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
29 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
30
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
31 public NetworkNodeOperation(int _pos, Command _command) {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
32 pos = _pos;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
33 command = _command;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
34 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
35
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
36 public NetworkNodeOperation(String _key, Command _command) {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
37 key = _key;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
38 command = _command;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
39 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
40
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
41 public NetworkNodeOperation(String _key, ByteBuffer _value, Command _command) {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
42 key = _key;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
43 value = _value;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
44 command = _command;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
45 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
46
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
47 public NetworkNodeOperation(Command _command) {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
48 command = _command;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
49 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
50
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
51 public int getPosition() {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
52 return pos;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
53 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
54
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
55 public String getKey() {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
56 return key;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
57 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
58
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
59 public ByteBuffer getValue() {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
60 return value;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
61 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
62
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
63 public Command getCommand() {
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
64 return command;
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
65 }
2dba7e1cf9fa Added NetworknodeOperation and Test
one
parents:
diff changeset
66 }