Mercurial > hg > Database > jungle-network
annotate src/jungle/test/alice/HashSetConvertTest.java @ 58:4851344e120e
fix bug LogUpdateCodeSegment and ChildLogCheckCodeSegment
author | one |
---|---|
date | Mon, 15 Jul 2013 10:13:34 +0900 |
parents | src/test/alice/jungle/codesegment/HashSetConvertTest.java@9e782b4eb06e |
children |
rev | line source |
---|---|
58
4851344e120e
fix bug LogUpdateCodeSegment and ChildLogCheckCodeSegment
one
parents:
51
diff
changeset
|
1 package jungle.test.alice; |
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 } |