Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/alice/jungle/operations/NetworkNodePath.java @ 79:5b9708d9febc
Modified NetworkTreeOperationLog NetworkNodeOperation
author | one |
---|---|
date | Wed, 16 Oct 2013 19:25:02 +0900 |
parents | 9e3198bf9547 |
children | b3ccefdf2b43 |
comparison
equal
deleted
inserted
replaced
78:0055d917c796 | 79:5b9708d9febc |
---|---|
1 package alice.jungle.operations; | 1 package alice.jungle.operations; |
2 | 2 |
3 import java.io.IOException; | |
4 import java.util.Iterator; | 3 import java.util.Iterator; |
5 import java.util.LinkedList; | 4 import java.util.LinkedList; |
6 | 5 |
7 import org.msgpack.MessagePack; | |
8 import org.msgpack.annotation.Message; | 6 import org.msgpack.annotation.Message; |
9 import org.msgpack.type.Value; | |
10 | 7 |
11 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; | 8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; |
12 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; | 9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; |
13 | 10 |
14 @Message | 11 @Message |
15 public class NetworkNodePath implements NodePath | 12 public class NetworkNodePath implements NodePath |
16 { | 13 { |
17 LinkedList<Integer> path; | 14 LinkedList<Integer> path; |
18 | |
19 public static void main(String[] args) throws IOException { | |
20 NetworkNodePath path = new NetworkNodePath(); | |
21 path = path.add(1).add(2).add(3); | |
22 MessagePack msgpack = new MessagePack(); | |
23 Value value = msgpack.unconvert(path); | |
24 NetworkNodePath mPath = msgpack.convert(value, NetworkNodePath.class); | |
25 for (Integer i : mPath) { | |
26 System.out.println(i); | |
27 } | |
28 } | |
29 | 15 |
30 public NetworkNodePath() { | 16 public NetworkNodePath() { |
31 path = new LinkedList<Integer>(); | 17 path = new LinkedList<Integer>(); |
32 } | 18 } |
33 | 19 |