public final String toString(){
  StringBuffer text=new StringBuffer();
  text.append("Print impurity values:\n");
  text.append("    Number of total instances:\t" + n + "\n");
  text.append("    Splitting attribute:\t\t" + attr + "\n");
  text.append("    Number of the instances in the left:\t" + nl + "\n");
  text.append("    Number of the instances in the right:\t" + nr + "\n");
  text.append("    Sum of the left:\t\t\t" + sl + "\n");
  text.append("    Sum of the right:\t\t\t" + sr + "\n");
  text.append("    Squared sum of the left:\t\t" + s2l + "\n");
  text.append("    Squared sum of the right:\t\t" + s2r + "\n");
  text.append("    Standard deviation of the left:\t" + sdl + "\n");
  text.append("    Standard deviation of the right:\t" + sdr + "\n");
  text.append("    Variance of the left:\t\t" + vr + "\n");
  text.append("    Variance of the right:\t\t" + vr + "\n");
  text.append("    Overall standard deviation:\t\t" + sd + "\n");
  text.append("    Overall variance:\t\t\t" + va + "\n");
  text.append("    Impurity (order " + order + "):\t\t"+ impurity+ "\n");
  return text.toString();
}

public final String toString ( ) { StringBuffer text = new StringBuffer ( ) ; text . append ( "Print impurity values:\n" ) ; text . append ( "    Number of total instances:\t" + n + "\n" ) ; text . append ( "    Splitting attribute:\t\t" + attr + "\n" ) ; text . append ( "    Number of the instances in the left:\t" + nl + "\n" ) ; text . append ( "    Number of the instances in the right:\t" + nr + "\n" ) ; text . append ( "    Sum of the left:\t\t\t" + sl + "\n" ) ; text . append ( "    Sum of the right:\t\t\t" + sr + "\n" ) ; text . append ( "    Squared sum of the left:\t\t" + s2l + "\n" ) ; text . append ( "    Squared sum of the right:\t\t" + s2r + "\n" ) ; text . append ( "    Standard deviation of the left:\t" + sdl + "\n" ) ; text . append ( "    Standard deviation of the right:\t" + sdr + "\n" ) ; text . append ( "    Variance of the left:\t\t" + vr + "\n" ) ; text . append ( "    Variance of the right:\t\t" + vr + "\n" ) ; text . append ( "    Overall standard deviation:\t\t" + sd + "\n" ) ; text . append ( "    Overall variance:\t\t\t" + va + "\n" ) ; text . append ( "    Impurity (order " + order + "):\t\t" + impurity + "\n" ) ; return text . toString ( ) ; }
converts an impurity object to a string
