view src/test/java/christie/example/PrefixTree/sendOrDisplay.java @ 272:b592fe1d4a4e default tip

create example Attendance
author matac42 <matac@cr.ie.u-ryukyu.ac.jp>
date Thu, 01 Jul 2021 20:41:07 +0900
parents 371c8492753e
children
line wrap: on
line source

package christie.example.PrefixTree;

import christie.annotation.Peek;
import christie.annotation.Take;
import christie.codegear.CodeGear;
import christie.codegear.CodeGearManager;
import christie.topology.Message;
import christie.topology.TopologyDataGear;
import christie.topology.node.TopologyNodeConfig;

public class sendOrDisplay extends CodeGear {
    @Take
    int num;

    @Peek
    TopologyDataGear topoDG;

    @Peek
    TopologyNodeConfig topologyNodeConfig;

    @Override
    protected void run(CodeGearManager cgm) {
         if(topoDG.getConnectionList().contains("parent")){
             System.out.println(num);
            put("parent", "pushedNum", num);
        }else{
            System.out.println("total:" + num);
            getDGM(topologyNodeConfig.getManagerKey()).put("FINISHMESSAGE", new Message());
        }
    }
}