示例#1
0
        public virtual string ToString(int depth, IStringBuilder buf)
        {
            if (attributeName != null)
            {
                buf.Append(Util.ntimes("\t", depth));
                buf.Append(Util.ntimes("***", 1));
                buf.Append(attributeName + " \n");
                foreach (string attributeValue in nodes.GetKeys())
                {
                    buf.Append(Util.ntimes("\t", depth + 1));
                    buf.Append("+" + attributeValue);
                    buf.Append("\n");
                    DecisionTree child = nodes.Get(attributeValue);
                    buf.Append(child.ToString(depth + 1, TextFactory.CreateStringBuilder()));
                }
            }

            return(buf.ToString());
        }