view src/test/java/alice/jungle/HashSetConvertTest.java @ 145:0340a3321e6c

Modified pom.xml
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 28 Jan 2014 06:25:47 +0900
parents f9e29a52efd3
children
line wrap: on
line source

package alice.jungle;

import java.util.HashSet;

import org.msgpack.annotation.Message;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;

public class HashSetConvertTest extends CodeSegment {
	
	Receiver hash = ids.create(CommandType.TAKE);

	public HashSetConvertTest() {
		hash.setKey("hash");
	}
	
	public static void main(String[] args) {
		HashSetDataSegment h = new HashSetDataSegment();
		h.hash.add("test1");
		h.hash.add("test2");
		
		HashSetConvertTest cs = new HashSetConvertTest();
		cs.ods.put("hash", h);
	}
	
	public void run() {
		HashSetDataSegment h = hash.asClass(HashSetDataSegment.class);
		for(String s : h.hash ) {
			System.out.println("s : "+s);
		}
		System.exit(0);
	}
	
	@Message
	private static class HashSetDataSegment {
		public HashSet<String> hash = new HashSet<String>();		
		public HashSetDataSegment() {}
	}
}