comparison src/test/alice/jungle/codesegment/HashSetConvertTest.java @ 51:9e782b4eb06e

add HashSetConvertDataSegment
author one
date Sat, 13 Jul 2013 15:59:47 +0900
parents
children
comparison
equal deleted inserted replaced
50:459b50f1a6ee 51:9e782b4eb06e
1 package test.alice.jungle.codesegment;
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 }