view 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
line wrap: on
line source

package jungle.test.alice;

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() {}
	}
}