diff src/main/java/alice/test/topology/aquarium/fx/SendDataOthers.java @ 383:878d397904da multicast

draw same Scene
author sugi
date Tue, 10 Jun 2014 19:36:46 +0900
parents
children 56d4f93a3921
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/alice/test/topology/aquarium/fx/SendDataOthers.java	Tue Jun 10 19:36:46 2014 +0900
@@ -0,0 +1,33 @@
+package alice.test.topology.aquarium.fx;
+
+import java.util.List;
+
+import alice.codesegment.CodeSegment;
+import alice.datasegment.CommandType;
+import alice.datasegment.Receiver;
+
+public class SendDataOthers extends CodeSegment {
+	
+	private Receiver info = ids.create(CommandType.PEEK);
+	private Receiver info1; // should use dataSegment
+	private String key;     // should use dataSegment
+	
+	public SendDataOthers(Receiver r, String key){
+		this.key = key;
+		info1 = r;
+		info.setKey("_CLIST");
+	}
+	
+	@Override
+	public void run() {
+		System.out.println(key);
+		@SuppressWarnings("unchecked")
+		List<String> nodes = info.asClass(List.class);
+		for (String node : nodes) {
+			System.out.println(node);
+			if (!info1.from.equals(node))
+				ods.put(node, key, info1.getVal());
+		}
+	}
+
+}