public int toGraph(StringBuffer text, int num) throws Exception {  int maxIndex = Utils.maxIndex(m_ClassProbs); String classValue = m_Info.classAttribute().value(maxIndex);  num++; if (m_Attribute == -1) { text.append("N" + Integer.toHexString(hashCode()) + " [label=\"" + num + ": " + classValue + "\"" + "shape=box]\n"); }else { text.append("N" + Integer.toHexString(hashCode()) + " [label=\"" + num + ": " + classValue + "\"]\n"); for (int i = 0; i < m_Successors.length; i++) { text.append("N" + Integer.toHexString(hashCode()) + "->" + "N" + Integer.toHexString(m_Successors[i].hashCode())  + " [label=\"" + m_Info.attribute(m_Attribute).name()); if (m_Info.attribute(m_Attribute).isNumeric()) { if (i == 0) { text.append(" < " + Utils.doubleToString(m_SplitPoint, 2)); } else { text.append(" >= " + Utils.doubleToString(m_SplitPoint, 2)); } } else { text.append(" = " + m_Info.attribute(m_Attribute).value(i)); } text.append("\"]\n"); num = m_Successors[i].toGraph(text, num); }
public String toGraph() {  try { StringBuffer resultBuff = new StringBuffer(); toGraph(resultBuff, 0); String result = "digraph Tree {\n" + "edge [style=bold]\n" + resultBuff.toString() + "\n}\n"; return result; } catch (Exception e) { return null;
  public int toGraph(StringBuffer text, int num) throws Exception {        int maxIndex = Utils.maxIndex(m_ClassProbs);    String classValue = m_Info.classAttribute().value(maxIndex);        num++;    if (m_Attribute == -1) {      text.append("N" + Integer.toHexString(hashCode()) +		  " [label=\"" + num + ": " + classValue + "\"" +		  "shape=box]\n");    }else {      text.append("N" + Integer.toHexString(hashCode()) +		  " [label=\"" + num + ": " + classValue + "\"]\n");      for (int i = 0; i < m_Successors.length; i++) {	text.append("N" + Integer.toHexString(hashCode()) 		    + "->" + 		    "N" + Integer.toHexString(m_Successors[i].hashCode())  +		    " [label=\"" + m_Info.attribute(m_Attribute).name());	if (m_Info.attribute(m_Attribute).isNumeric()) {	  if (i == 0) {	    text.append(" < " +			Utils.doubleToString(m_SplitPoint, 2));	  } else {	    text.append(" >= " +			Utils.doubleToString(m_SplitPoint, 2));	  }	} else {	  text.append(" = " + m_Info.attribute(m_Attribute).value(i));	}	text.append("\"]\n");	num = m_Successors[i].toGraph(text, num);      }    }        return num;  }