105
|
1 package alice.jungle;
|
51
|
2
|
|
3 import java.util.HashSet;
|
|
4
|
|
5 import org.msgpack.annotation.Message;
|
|
6
|
|
7 import alice.codesegment.CodeSegment;
|
|
8 import alice.datasegment.CommandType;
|
|
9 import alice.datasegment.Receiver;
|
|
10
|
|
11 public class HashSetConvertTest extends CodeSegment {
|
|
12
|
|
13 Receiver hash = ids.create(CommandType.TAKE);
|
|
14
|
|
15 public HashSetConvertTest() {
|
|
16 hash.setKey("hash");
|
|
17 }
|
|
18
|
|
19 public static void main(String[] args) {
|
|
20 HashSetDataSegment h = new HashSetDataSegment();
|
|
21 h.hash.add("test1");
|
|
22 h.hash.add("test2");
|
|
23
|
|
24 HashSetConvertTest cs = new HashSetConvertTest();
|
|
25 cs.ods.put("hash", h);
|
|
26 }
|
|
27
|
|
28 public void run() {
|
|
29 HashSetDataSegment h = hash.asClass(HashSetDataSegment.class);
|
|
30 for(String s : h.hash ) {
|
|
31 System.out.println("s : "+s);
|
|
32 }
|
|
33 System.exit(0);
|
|
34 }
|
|
35
|
|
36 @Message
|
|
37 private static class HashSetDataSegment {
|
|
38 public HashSet<String> hash = new HashSet<String>();
|
|
39 public HashSetDataSegment() {}
|
|
40 }
|
|
41 }
|