view src/main/java/alice/test/codesegment/remote/RemoteIncrement.java @ 534:82cc94d40628 dispose

bug
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Mon, 15 Jun 2015 17:21:51 +0900
parents b3c9554ccb1b
children d2f7d02c4976
line wrap: on
line source

package alice.test.codesegment.remote;

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

public class RemoteIncrement extends CodeSegment {

    public Receiver num = ids.create(CommandType.TAKE);//true でCompressedDSMからtake

    /**
     * Increment DataSegment value up to 10
     */
    @Override
    public void run() {
        int num = this.num.asInteger();
        System.out.println("[CodeSegment] " + num++);
        if (num == 10) System.exit(0);

        RemoteIncrement cs = new RemoteIncrement();
        cs.num.setKey("remote", "num");

        ods.put("local", "num", num);
    }

}