@@ -0,0 +1,2409 @@
+package edu.grinnell.callaway;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Vector;%0A%0A// This needs to be moved to the other class at some point...%0Apublic class ToString%0A%7B%0A  // /http://stackoverflow.com/questions/10462819/get-keys-from-hashmap-in-java%0A  @SuppressWarnings(%22unchecked%22)%0A  public static String toStr(HashMap%3CString, Object%3E hash)%0A  %7B%0A    String str = %22%7B%22;%0A    for (String key : hash.keySet())%0A      %7B%0A        Object val = hash.get(key);%0A        str += %22%5C%22%22 + key + %22%5C%22:%22;%0A%0A        if (val == null)%0A          str += val + %22,%22;%0A        else if (val.getClass().equals(HashMap.class))%0A          str += toStr((HashMap%3CString, Object%3E) val) + %22,%22;%0A        else if (val.getClass().equals(String.class))%0A          str += %22%5C%22%22 + val + %22%5C%22,%22;%0A        else if (val.getClass().equals(Vector.class))%0A          str += vecToString((Vector%3C?%3E) val) + %22,%22;%0A        else%0A          str += val + %22,%22;%0A      %7D // for (key)%0A    str = str.substring(0, str.length() - 1) + %22%7D%22;%0A    return str;%0A  %7D // toStr(HashMap)%0A%0A  @SuppressWarnings(%22unchecked%22)%0A  public static String vecToString(Vector%3C?%3E vec)%0A  %7B%0A    String str = %22%5B%22;%0A%0A    for (int i = 0; i %3C vec.size(); i++)%0A      %7B%0A        Object val = vec.get(i);%0A%0A        if (val == null)%0A          str += val + %22,%22;%0A        else if (val.getClass().equals(Vector.class))%0A          str += vecToString((Vector%3C?%3E) val) + %22,%22;%0A        else if (val.getClass().equals(HashMap.class))%0A          str += toStr((HashMap%3CString, Object%3E) val) + %22,%22;%0A        else if (val.getClass().equals(String.class))%0A          str += %22%5C%22%22 + val + %22%5C%22,%22;%0A        else%0A          str += val + %22,%22;%0A      %7D // for (i)%0A    str = str.substring(0, str.length() - 1) + %22%5D%22;%0A    return str;%0A  %7D // vecToString(Vector)%0A%0A  public static void main(String args%5B%5D)%0A  %7B%0A    HashMap%3CString, Object%3E htable = new HashMap%3CString, Object%3E(8);%0A    %0A    Vector vector = new Vector(3);%0A    vector.add(1);%0A    vector.add(2);%0A%0A    Vector vector2 = new Vector(3);%0A    vector2.add(vector);%0A    vector2.add(2);%0A%0A    HashMap%3CString, Object%3E htab = new HashMap%3CString, Object%3E(3);%0A%0A    htab.put(%22x%22, %22it%22);%0A    htab.put(%22y%22, 2.7e-4);%0A%0A    vector.add(htab);%0A%0A    htable.put(%22a%22, true);%0A    htable.put(%22b%22, 2.7e-4);%0A    htable.put(%22c%22, %22The%22);%0A    htable.put(%22j%22, vector2);%0A    htable.put(%22d%22, vector);%0A    htable.put(%22e%22, null);%0A    htable.put(%22f%22, htab);%0A%0A    System.out.println(toStr(htable));%0A  %7D // main%0A%7D // class ToString%0A

create toStr and vecToString