public static String hashMapToString(HashMap<?,?> map,int dp){
  StringBuilder sb=new StringBuilder();
  for (  Object k : map.keySet()) {
    sb.append(Utils.padRight(k.toString(),31));
    Object obj=map.get(k);
    if (obj instanceof Double) {
      sb.append(Utils.doubleToString((Double)obj,5,dp));
    }
 else     if (obj instanceof double[]) {
      sb.append(A.toString((double[])obj,dp));
    }
 else     if (obj instanceof int[]) {
      sb.append(A.toString((int[])obj,dp + 2));
    }
 else     if (obj instanceof String) {
      String s=(String)obj;
      if (s.contains("\n"))       sb.append("\n");
      sb.append(obj);
      if (s.contains("\n"))       sb.append("\n");
    }
 else {
    }
    sb.append('\n');
  }
  return sb.toString();
}

public static String hashMapToString ( HashMap < ? , ? > map , int dp ) { StringBuilder sb = new StringBuilder ( ) ; for ( Object k : map . keySet ( ) ) { sb . append ( Utils . padRight ( k . toString ( ) , 31 ) ) ; Object obj = map . get ( k ) ; if ( obj instanceof Double ) { sb . append ( Utils . doubleToString ( ( Double ) obj , 5 , dp ) ) ; } else if ( obj instanceof double [ ] ) { sb . append ( A . toString ( ( double [ ] ) obj , dp ) ) ; } else if ( obj instanceof int [ ] ) { sb . append ( A . toString ( ( int [ ] ) obj , dp + 2 ) ) ; } else if ( obj instanceof String ) { String s = ( String ) obj ; if ( s . contains ( "\n" ) ) sb . append ( "\n" ) ; sb . append ( obj ) ; if ( s . contains ( "\n" ) ) sb . append ( "\n" ) ; } else { } sb . append ( '\n' ) ; } return sb . toString ( ) ; }
print out a hashmap nicely .
