Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/alice/jungle/operations/NetworkNodePath.java @ 68:b0af3960917f
Added NetworkNodePathTest
author | one |
---|---|
date | Thu, 10 Oct 2013 20:26:33 +0900 |
parents | 89e39301ccaa |
children | 9e3198bf9547 |
comparison
equal
deleted
inserted
replaced
67:89e39301ccaa | 68:b0af3960917f |
---|---|
1 package alice.jungle.operations; | 1 package alice.jungle.operations; |
2 | 2 |
3 import java.io.IOException; | |
3 import java.util.Iterator; | 4 import java.util.Iterator; |
4 import java.util.LinkedList; | 5 import java.util.LinkedList; |
6 | |
7 import org.msgpack.MessagePack; | |
8 import org.msgpack.annotation.Message; | |
9 import org.msgpack.type.Value; | |
5 | 10 |
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; | 11 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; |
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; | 12 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; |
8 | 13 |
9 @Message | 14 @Message |
10 public class NetworkNodePath implements NodePath | 15 public class NetworkNodePath implements NodePath |
11 { | 16 { |
12 LinkedList<Integer> path; | 17 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 } | |
13 | 29 |
14 public NetworkNodePath() { | 30 public NetworkNodePath() { |
15 path = new LinkedList<Integer>(); | 31 path = new LinkedList<Integer>(); |
16 } | 32 } |
17 | 33 |