view src/main/java/alice/test/topology/aquarium/fx/RegisterList.java @ 394:c0cf9fe00d77 multicast

add direction Information
author sugi
date Tue, 17 Jun 2014 17:11:18 +0900
parents 1cbac5818dca
children ca92da166f1a
line wrap: on
line source

package alice.test.topology.aquarium.fx;

import java.util.List;

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

public class RegisterList extends CodeSegment{

	private Receiver info = ids.create(CommandType.TAKE);  // created fish object info
	private Receiver info1 = ids.create(CommandType.PEEK); // created fish List
	
	public RegisterList(){
		info.setKey("register");
		info1.setKey("registeredList");
	}
	
	@Override
	public void run() {
		FishInfo fishInfo = info.asClass(FishInfo.class);
	
		@SuppressWarnings("unchecked")
		List<FishInfo> list = info1.asClass(List.class);
		
		list.add(fishInfo);
		ods.update(info1.key, list);
		new SendDataOthers(info1, "registeredList");
		new RegisterList();
	}

}