Mercurial > hg > Database > Alice
view src/alice/test/topology/fish/AsignStartX.java @ 216:21bd8af1cf26 working
change asClass method
author | one |
---|---|
date | Wed, 27 Mar 2013 19:38:33 +0900 |
parents | fec0726bb126 |
children |
line wrap: on
line source
package alice.test.topology.fish; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class AsignStartX extends CodeSegment { public Receiver routing = ids.create(CommandType.PEEK); public int startX; public int index; public AsignStartX(int startX, int index) { this.startX = startX; this.index = index; } @Override public void run() { System.out.println("AsignStartX: " + startX); RoutingTable routing = this.routing.asClass(RoutingTable.class); int x = startX; System.out.println("RoutingTable: " + this.routing.getVal()); if (this.index >= this.routing.index) { AsignStartX cs = new AsignStartX(startX, index); cs.routing.setKey("local", "routing", this.routing.index); return; } for (Routing r : routing.table) { System.out.println(r.name); ods.update(r.name, "startX", x); System.out.println("Assign: " + r.name + ".startX = " + x); x += r.width; } PeekStartX cs = new PeekStartX(this.routing.index); cs.startX.setKey("local", "startX", this.index); } }