import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TreeNode {

    // 如果是叶子节点的话,label就为"是"or"不是",内部节点则仍为null
    private String label = null;

    // signature告知了当前节点判断的依据,比如"色泽"or"根蒂"等
    private String signature = null;
    // children的key其实是signature对应数据的值域,比如"青绿"or"乌黑"等,而value则是真正的子节点
    private Map<String, TreeNode> children = new HashMap<>();

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public Map<String, TreeNode> getChildren() {
        return children;
    }

    public void setChildren(Map<String, TreeNode> children) {
        this.children = children;
    }

    static public String getLabel(List<String> data, TreeNode thisNode){
        if(thisNode.getLabel() != null){
            return thisNode.getLabel();
        }
        String header = thisNode.getSignature();
        Integer index = FileUtils.header2IndexMap.get(header);
        String dataValue = data.get(index);
        TreeNode child = thisNode.getChildren().get(dataValue);
        if(child == null){
            throw new IllegalArgumentException("当前决策树无法判断该数据");
        }
        return getLabel(data, child);
    }
}

@@ -1181,16 +1181,132 @@
 index);%0A
+        if(thisNode.getChildren()==null)%7B%0A            throw new IllegalArgumentException(%22%E5%BD%93%E5%89%8D%E5%86%B3%E7%AD%96%E6%A0%91%E6%97%A0%E6%B3%95%E5%88%A4%E6%96%AD%E8%AF%A5%E6%95%B0%E6%8D%AE%22);%0A        %7D%0A
         

fix children be null