view src/main/java/alice/test/codesegment/local/factorial/StartCodeSegment.java @ 655:1c93e82e05c6 default tip

fix timestamp
author suruga
date Sat, 17 Feb 2018 00:33:00 +0900
parents 145c425db88d
children
line wrap: on
line source

package alice.test.codesegment.local.factorial;

import alice.codesegment.CodeSegment;
import alice.test.codesegment.local.TestCodeSegment;

/**
 * Created by e125769 on 2/24/15.
 */
public class StartCodeSegment extends CodeSegment{

    @Override
    public void run() {//データをセット&表示をするCS
        System.out.println("run StartCodeSegment");

        FactorialCodeSegment cs[] = new FactorialCodeSegment[4];//計算するCSを用意

        System.out.println("create FactorialCodeSegment");

        for (int i = 0; i < cs.length; i++){//4回CSを走らせている
            cs[i] = new FactorialCodeSegment(5, "key" + i);//配列にCSインスタンスを代入 newした時点でコンストラクタのsetKeyでデータを取りに行く
        }

        for (long i = 1; i <= 20; i++) {//1~100までを4つのキューに格納
            if (i <= 5){//一応パイプライン状に走る
                ods.put("local", "key0", i);
            } else if (5 < i && i <= 10){
                ods.put("local", "key1", i);
            } else if (10 < i && i <= 15){
                ods.put("local", "key2", i);
            } else{
                ods.put("local", "key3", i);
            }
        }


    }

}