Mercurial > hg > Database > Christie
view src/test/java/christie/example/PrefixTree/CountCalculate.java @ 207:437f06e034b8
Correct PrefixTree
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 11 Mar 2019 22:21:23 +0900 |
parents | 7beaa2839c3c |
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; public class CountCalculate extends CodeGear { @Peek TopologyDataGear topoDG; @Override protected void run(CodeGearManager cgm) { int childNum = topoDG.getConnectionList().size(); for(String nodeName : topoDG.getConnectionList()) { if(nodeName.matches("parent")) { childNum = childNum - 1; } } if (childNum == 0) { put("pushedNum", 0); } put("count", 0); put("childNodeNum", childNum); cgm.setup(new Calculate()); } }